Pages

Thursday, 8 January 2015

C Program To Add Two Numbers

/* Addition of two numbers in c */

For any query regarding c/c++ feel free to contact me on khimanichirag@gmail.com or comment below. I try my best to solve it.

 #include<stdio.h>  
 #include<conio.h>  
 void main()  
 {  
      int n1,n2,result=0;  
      clrscr();  
      printf("Enter first number: ");  
      scanf("%d",&n1);  
      printf("\nEnter the second number: ");  
      scanf("%d",&n2);  
      result=n1+n2;  
      printf("\nThe sum of two number is: %d",result);  
      getch();  
 }  

No comments:

Post a Comment