Friday, 24 June 2016

program to add two number

hello guys today i m gonna show u a basic program to add to no....
so there are five airthematic operator in c/c++

  • + addition
  • - substraction
  • * multiplication
  • / division
  • % mod/remainder
here is an illustration to build a basic program to add to no :-

#include<stdio.h>
void main()
{
int a,b;
scanf("%d %d",&a,&b);   //inputing two no from the user
printf("\n addition = %d",a+b);
}

so this way we can add subs or perform any mathematical operation ....
we can also use 3 variable to perform same action by writing

c=a+b;
printf("addition=%d",&c);


Location: India

0 comments:

Post a Comment