#include <stdio.h>
int main()
{
char line[150];
int i, vowels, consonants, digits, spaces;
vowels = consonants = digits = spaces = 0;
printf("Enter a line of string: ");
scanf("%[^\n]", line);
for(i=0; line[i]!='\0'; ++i)
{
if(line[i]=='a' || line[i]=='e' || line[i]=='i' ||
line[i]=='o' || line[i]=='u' || line[i]=='A' ||
...
Sunday, 4 March 2018
Finding the Number of 500,100,50,20,10,5,2 and 1 Rupee Notes in a Given Amount.
# include <stdio.h>
# include <conio.h>
void main()
{
int rs, a, b, c, d, e, f, g, h ;
clrscr() ;
printf("Enter the amount in Rupees : ") ;
scanf("%d", &rs) ;
while(rs >= 500)
{
a = rs / 500 ;
rs = rs % 500;
printf("\nThe no. of five hundreds are : %d", a) ;
break ;
}
while(rs >= 100)
{
b = rs / 100 ;
rs = rs % 100;
printf("\n\nThe no. of hundreds are : %d", b) ;
break ;
}
while(rs >= 50)
{
c = rs / 50 ;
rs = rs % 50;
printf("\n\nThe no. of fifties are : %d", c) ;...
Subscribe to:
Posts (Atom)