Skip to main content

Posts

Showing posts from August 20, 2012

program to find total no. of currency notes(100,50,10) of the enterd value

LIST OF PROGRAMS eg: Enter a amount = 560 No. of Rs.100 notes  = 5 No. of Rs.50 notes  = 1 No. of Rs.10 notes  = 1 #include<stdio.h> #include<conio.h> void main() { long int n,x=0;  clrscr(); printf("Enter a amount = \n"); scanf("%ld",&n); x=n/100; printf("No. of Rs.100 notes  = %ld\n",x); n=n%100; x=n/50; printf("No. of Rs.50 notes  = %ld\n",x); n=n%50; x=n/10; printf("No. of Rs.10 notes  = %ld\n",x); getch(); } LIST OF PROGRAMS

program to print a new number by adding one to each of its digits

#include<stdio.h> #include<conio.h> void main() { long int n,i2=1,i=0,sum2=0,num,x,sum=0;  clrscr(); printf("Enter a number="); scanf("%ld",&n); x=n; while(n>0) { sum++; n=n/10; } printf("Number of digits in this number=%ld",sum); while(i<sum) { sum2=x+i2; i2=i2*10+1; i++; } printf("Number formed %ld",sum2); getch(); } LIST OF PROGRAMS