Tuesday, 23 September 2014

A C Program To Perform Addition Of Two Numbers.


Source Code:

#include <stdio.h>
#include <conio.h>

// Addition program by Akshay...

void main()
{
  int a,b,c;
  clrscr();
  printf("\n Please enter value of a ");
  scanf("%d",&a);
  printf("\n Value of a is = %d \n", a);
  printf("\n Please enter value of b ");
  scanf("%d", &b);
  printf("\n Value of b is = %d\n", b);
  sum=a+b;
  printf("\n Sum of a & b is = %d", sum);
  getch();
}

// Done!!

After writing the source code save with extension .CPP 

Output:


No comments :

Post a Comment