Skip to main content

Posts

Showing posts with the label 20. Write a C program to count total number of notes in given amount.

ads1

20. Write a C program to count total number of notes in given amount.

 20 . Write a C program to count total number of notes in given amount. Solution :-  #include<stdio.h> #include<conio.h> void main() {     clrscr();     int amount;     int note2000,note500,note200,note100,note50,note20,note10,note5,note2,note1;     note2000=note500=note200=note100=note50=note20=note10=note5=note2=note1=0;     printf("Enter the amount :-");     scanf("%d",&amount);     if(amount>=2000)     {         note2000 = amount/2000;         amount = amount -note2000*2000;     }     if(amount >= 500)     {         note500 = amount/500;         amount = amount - note500*500;     }      if(amount >= 200)     {         note200 = amount/200;         amount = amount - note200*200;     }         if(amount >= 100)     {         note100 = amount/100;         amount = amount - note100*100;     }          if(amount >= 50)     {         note50 = amount/50;         amount = amount - note50*50;     }          if(amount >= 20)     {        

ads2