Ad

Chapter - 2: C Instructions

If a five-digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits. For example, if the number that is input is 12391 then the output should be displayed as 23402.


Ad
H
Sections
5
Exercises
#include<stdio.h>
#include<conio.h>
int main()
{
	int num;
	
	printf("Enter a five digit number : ");
	scanf("%d", &num);
	
	num = num + 11111;
	
	printf("%d is the asked number.",num);
	
	getch();
	return 0;
}
Ad

© 2024 Garbage Valuegarbage value logo