Write a program to print sum in c
#include<stdio.h>
int b; //Global variable
void main()
{
int a,c; //Local variable
printf("enter the two number ");
scanf("%d %d",&a, &b);
c=a+b;
printf("sum of two number = %d ",c);
return 0;
}
OUTPUT
enter the two number
5
8
sum of two number = 13
Write a program to print sum, subtract, multiply, Divide.
#include<stdio.h>
int main()
{
int a,b,c;
printf("Enter the two number ");
scanf("%d %d",&a, &b);
c=a+b;
printf("\n sum of two number = %d ",c);
c=a-b;
printf("\n Subtraction of two number = %d ",c);
c=a*b;
printf("\n Multiplication of two number = %d ",c);
c=a/b;
printf("\n Division of two number = %d ",c);
return 0;
}
OUTPUT
Enter the two number 10
5
sum of two number = 15
Subtraction of two number = 5
Multiplication of two number = 50
Division of two number = 2
No comments:
Post a Comment