C Language Program to find Individual Sum of digits of a three digit number.

C - SIMPLE  PROGRAMS


7:  C Language Program to find Individual Sum of digits of a three digit number.


#include<stdio.h>
#include<conio.h>
main( )
{
int n,a,b,c,sum;
printf("\nEnter a three digit number : ");
scanf("%d",&n);
a=n/100;
b=(n%100)/10;
c=n%10;
sum=a+b+c;
printf("\nSum of three indivisual digits = %d",sum);
getch( );

}


Post a Comment

0 Comments