#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
int a;
scanf("%d", &a); // sample code for four digit number 1234
int b,c,d,e;
b=a%10;a=a/10;
c=a%10;a=a/10;
d=a%10;a=a/10;
e=a%10;e=e+1;
if(b>=9)
{b=0;c=c+1;
}
else
b=b+1;
if(c>=9)
{
c=0;d=d+1;
}
else
c=c+1;
if(d>=9)
{
d=0;e=e+1;
}
else
d=d+1;
printf("%d%d%d%d\n", e,d,c,b);
}
No comments:
Post a Comment
Comments please: