Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

if a 5 digit number is input through the keyboard try to print a new number by adding 1 to each digit

0 votes
asked Aug 16, 2019 by Sai Kumar Golanukonda (120 points)

4 Answers

+1 vote
answered Aug 22, 2019 by bhoomi2000 (780 points)

#include<stdio.h>

#include<conio.h>

void main();

{

         int a,b;

        scanf("%d",&a);

        b=a+11111;

        printf("new digit: %d",b);

       getch();

}

0 votes
answered Aug 24, 2019 by anonymous

#include<stdio.h>

#include<conio.h>

void main();

{

         int a,b;

        scanf("%d",&a);

        b=a+11111;

        printf("new digit: %d",b);

       getch();

}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.

ads via CarbonHave fun taking surveys and get paid!ADS VIA CARBON

Snow Theme by Q2A Market

Powered by Question2Answer

#include<stdio.h>

#include<conio.h>

void main();

{

         int a,b;

        scanf("%d",&a);

        b=a+1;

        printf("new digit: %d",b);

       getch();

}

commented Sep 3, 2019 by anonymous
galat hai  bhai..hr digit me 1 add krna h
0 votes
answered Aug 26, 2019 by anonymous
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int number, f=0,n,i=0;
    cout<<"enter the number"<<endl;
    cin>>number;
    
    while(number)
    {
        n=number%10;
        n=n+1;
        number=number/10;
        f=f+n*pow(10,i);
        i++;
        
    }
    
    cout<<"the number is "<<f<<endl;
    return 0;
}
0 votes
answered Aug 27, 2019 by Bruce Wayne
#include<stdio.h>

#include<math.h>

void main()

{

int n,i=0,num=0;

printf("Enter a 5 digit number");

scanf("%i",&n);

while(n!=0)

{

d=n%10;

d=d+1;

num=num+d*pow(10,i);

i++;

n=n/10;

}

printf("\n Updated number is %i",num);

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...