fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int num1, num2, sum; // This creates 3 boxes for numbers
  5.  
  6. printf("Enter first number:5"); // Ask the user for first number
  7. scanf("%d", &num1); // Read the first number
  8.  
  9. printf("Enter second number:7"); // Ask the user for second number
  10. scanf("%d", &num2); // Read the second number
  11.  
  12. sum = num1 + num2; // Add the two numbers
  13.  
  14. printf("The sum is 12 %d\n", sum); // Show the result
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 5316KB
stdin
Standard input is empty
stdout
Enter first number:5Enter second number:7The sum is 12 -542919762