j

Monday, 2 November 2015

Write a program that take a number consisting of 3 digit and display sum of all digit



#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int n,c,d;
printf("Enter 3-digit number:");
scanf(%d”,&n)
c=n/100;
n=n%100;
d=n/10;
n=n%10;
printf("Sum of digit is ",n+d+c)
getch();
}

Subscribe to this Blog via Email :