Showing posts with label substraction. Show all posts
Showing posts with label substraction. Show all posts

Sunday, 31 December 2017

simple C or C++ program to find addition , substraction , multiplication and divide without using any function.

In this program we simply define two variable a,b for getting values. A is define first value and b is define second value.And we also define some more variables for storing the operational value.In this program we find addition, substraction, multiplication and divide. so we also  declare variables add,sub,div,multi for storing values.

SIMPLE C PROGRAM TO FIND ADD , SUBSTRACT , DIVIDE AND MULTIPLY.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,add,sub,div,multi;
clrscr();

printf("Enter the value for A and B==");
scanf("%d%d",&a,&b);

add=a+b;
printf("Addition is:-%d".&add);

sub=a-b;
printf("Substract is:-%d".&sub);

div=a/b;
printf("Divide is:-%d".&div);

multi=a*b;
printf("Multiply is:-%d".&multi);

getch();
}