Sample addition program using C


#include <stdio.h>

int main()

{

int x, y, sum;

printf(“Enter the first integer: \n”);

scanf(“%d”, &x);

printf(“Enter the second integer: \n”);

scanf(“%d”, &y);

sum = x + y;

printf(“The sum is : %d”, sum);

getchar();

return 0;

}

Sample Output:

Enter the first integer: 3

Enter the second integer: 4

The sum is: 7

About morej00
simple

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.