Calculate sum of the digits of a given number
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c;
printf("Enter Two Numbers :- ");
scanf("%d%d",&a,&b);
c=a+b;
printf("Sum Of Numbers:- %d",c);
getch();
}
Output:-
Enter Two Numbers :- 2
3
Sum Of Numbers:- 5
Comments
Post a Comment