1. W.A.P. for the addition of two numbers.
#include<stdio.h>
#include<conio.h>
main()
{
int num1,num2,sum;
clrscr();
printf(" Enter the value of num1 and num2 : - ");
scanf("%d %d",&num1,&num2);
sum=num1+num2;
printf(" Sum of two number is %d",sum);
getch();
}
2. W.A.P for the addition, subtraction, multiplication, division
of two numbers.
#include<stdio.h>
#include<conio.h>
main()
{
int num1,num2,sum,sub,mul;
float div=0;
clrscr();
printf("Enter the values of two numbers :- ");
scanf("%d %d", &num1,&num2);
sum=num1+num2;
sub=num1-num2;
mul=num1*num2;
div=num1/num2;
printf("sum is = %d\n Sub is = %d\n Mul is = %d\n
Div is = %d",sum,sub,mul.div);
getch();
}
OUTPUT :
Enter the value of num1 and num2:- 9 3
Sum is = 12
Sub is = 6
Mul is = 27
Div is = 3
You can see..
Program for Sum of digit
0 comments:
Post a Comment