Thursday, August 28, 2014

program which can take 2 numbers form user as an input, add them and print result


Code

#include<stdio.h>

int main ()

{
int a,b,c;

printf ("\nEnter 1st number: ");
scanf ("%d",&a);

printf ("\nEnter 2nd number: ");
scanf ("%d",&b);

c = (a+b);

printf ("\nSum = %d\n",c);

getch ();
return 0;
}

Output


C Language add 2 numbers

No comments :

Post a Comment

Note: Only a member of this blog may post a comment.

Copyright 2017. All Rights Reserved. Privacy Policy / Terms And Conditions / Sitemap / Contact