Write a C program to find the sum of individual digits of a 3 digit number.

Program Code:
#include<stdio.h>
int main()
{
int n,d1,d2,d3;
printf("\n enter the values of 3 digit no:");
scanf("%d",&n);
d1=n%10;
n=n/10;
d2=n%10;
n=n/10;
d3=n%10;
n=n/10;
n=d1+d2+d3;
printf("the sum of individual number=%d",n);
}
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: