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.


H
Sections
5
Exercises

A

B

C

D

E

F

G

H

1

2

3

4

5

6

7

8

9

10

#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;
}

© 2020 Garbage Valuegarbage value logo