Filled Under:

C program to perform addition, subtraction, multiplication and division

C program to perform addition, subtraction, multiplication and division


C program to perform addition, subtraction, multiplication and division


 In this program, I have discussed about C program to perform addition, subtraction, multiplication and division of two numbers.

----------------------------------------------------------------------------------------------------

#include<stdio.h>
void main()
{ int a,b,i,j; float m,d;
printf("Enter two numbers:");
scanf("%d",&a,&b);
i=a+b;
j=a-b;
m=a*b;
d=a/b;
printf(" The sum is %d",i);
printf("The subtracted value is %d",j);
printf("The multilied result is %d",m);
printf("The divided result is %d", d);
}


-----------------------------------------------------------------------

Just copy and paste the program in your desired compiler (Dev C++ is more preferable) and run it.


Enjoy programming in C.


0 comments:

Post a Comment

 

Copyright 2020 Programming in C All Right Reserved