A 5 digit number is input through the key board. Output is a new
number adding 1 to each of its digits in c programming
#include
int add(long int);
int main(){
long int num;
int add(long int);
printf("\nEnter a 5 digit number:
");
scanf("%ld",&num);
add(num);
return 0;
}
add(long int num){
long int r;
if(num){
r=num%10;
r=r+1;
No comments:
Post a Comment