cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
If you run my code, what is your output
If you run my code, what is your output ?
May 11, 2020 at 10:22pm UTC
paulgureghian
(1)
```
// Created by Paul A. Gureghian in May 2020. //
//This C program takes two integers and calculates the sum. //
// Start of program. //
// Import libraries. //
#include <stdio.h>
// Define the main(). //
int main()
{
int i, j, sum;
scanf("Enter 1'st integer: %d", &i);
scanf("Enter 2'nd integer: %d", &j);
sum = i + j;
printf("Sum is: %d\n", sum);
return 0;
}
// End of program. //
```
https://imgur.com/a/mpuBFCU
May 11, 2020 at 10:52pm UTC
jlb
(4973)
Do you realize that you must enter "Enter 1'st integer:" along with your number?
Anything that appears in a scanf() format string other than format specifiers must appear in the input.
Topic archived. No new replies allowed.