Status
Not open for further replies.

champ_007_bond

Banned
Banned
499
2009
69
0
Code:
using namespace std;
#include<iostream>
#include<conio.h>
int main()
{
    int x;
    cin>>x;
    int y=x/500;
    cout<<y;
    int z=x-500;
    int a=z/100;
    if(a>=1)
    {
            cout<<a;
            }
            else if(a<=0)
            {
                 int b=z/50;
                 if(b>=1)
                 {
                         cout<<b;
                         }
                         else if(b<=0)
                         {
                              int c=z/20;
                              if(c>=1)
                              {
                                      cout<<c;
                                      }
                                      else if(c<=0)
                                      {
                                           int d=z/10;
                                           if(d>=1)
                                           {
                                                   cout<<d;
                                                   else if(d<=0)
                                                   {
                                                        e=z/1;
                                                        cout<<e;
                                                        }
                                                   }
                                           }
                              }
                 }
    
    getch();
    return 0;
    }


Kindly help.!
 
Status
Not open for further replies.
Back
Top