Summation in C

The following program takes two, yes just two integers and returns the sum of them. Very basic program but might be helpful for my fellow CSE friends at KU.

 

/*
Add two numbers and print them out together
with their sum.
AUTHOR: maSnun
E-Mail: masnun@gmail.com

*/

#include <stdio.h>
int main(void) {
int first, second;
printf(“Enter two integers > “);
scanf(“%d %d”, &first, &second);
printf(“The two numbers are: %d %dn”, first, second);
printf(“Their sum is %dn”, first+second);
}

Tags: . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">