program to find sum of three digit number-by enggfact - Enggfact

Latest

Convert your Passion into your Profession

Monday, September 2, 2019

program to find sum of three digit number-by enggfact

#include<stdio.h>
int main()
{
int num,d1,d2,d3,sum;
printf("enter any three digit number");
scanf("%3d",&num);
d1=num%10;
num=num/10;
d2=num%10;
num=num/10;
d3=num%10;
num=num/10;
sum=d1+d2+d3;
printf("\n %d",sum);
return 0;
}

No comments:

Post a Comment