// A simple program demonstrating the use of scanf // to sum 2 numbers // Andrew Taylor - andrewt@unsw.edu.au // 6/3/2017 #include int main(void) { int x, y, sum; printf("Enter x: "); scanf("%d", &x); printf("Enter y: "); scanf("%d", &y); sum = x + y; // These 6 printfs can be better replaced by a single printf printf("%d", x); printf(" + "); printf("%d", y); printf(" = "); printf("%d", sum); printf("\n"); return 0; }