Write a program to input 2 numbers and print sum, subtraction, multiplication, division and modulus of those numbers.
#include<conio.h>
# include<stdio.h>
#include<stdlib.h>
// Write a program to input 2 numbers and print sum, subtraction, multiplication, division and modulus of those numbers.
int main()
{
int a,b;
printf("\n\tEnter number a = "); scanf("%d",&a);
printf("\n\tEnter number b = "); scanf("%d",&b);
printf("\n\n\tSum = %d + %d = %d",a,b,a+b);
printf("\n\n\tSubstractoin = %d - %d = %d",a,b,a-b);
printf("\n\n\tMultiplication = %d * %d = %d",a,b,a*b);
printf("\n\n\tDivision = %d / %d = %d",a,b,a/b);
printf("\n\n\tModulus = %d %c %d = %d",a,'%',b,a%b);
}
Comments
Leave a comment