Write a program for increment output value
Program:
#include<stdio.h>
main()
{
int n, x[50],j=0,i=0, y;
printf("Enter your value = ");
scanf("%d", &n);
while (n!=0)
{
y=n%10;
y++;
x[i]=y;
i++;
n=n/10;
}
for(j=i-1; j>=0; j--)
{
if (x[j]==10)
printf("0");
else
printf("%d", x[j]);
}
}
Program:
#include<stdio.h>
main()
{
int n, x[50],j=0,i=0, y;
printf("Enter your value = ");
scanf("%d", &n);
while (n!=0)
{
y=n%10;
y++;
x[i]=y;
i++;
n=n/10;
}
for(j=i-1; j>=0; j--)
{
if (x[j]==10)
printf("0");
else
printf("%d", x[j]);
}
}