fork download
  1. #include <stdio.h>
  2. int main(void) {
  3. int a, b;
  4. a =5; b = 6;
  5. printf("Please enter the value for a:\n");
  6. scanf("%d", &a); //&variable name gets the memory box
  7. printf("Please enter the value for b:\n");
  8. scanf("%d", &b);
  9. printf("a + b = %d\n", a + b);
  10. printf("a - b = %d\n", a - b);
  11. printf("a * b = %d\n", a * b);
  12. printf("a / b = %d\n", a / b);
  13. return 0;
  14. } //main
Success #stdin #stdout 0s 2172KB
stdin
5
6
stdout
Please enter the value for a:
Please enter the value for b:
a + b = 11
a - b = -1
a * b = 30
a / b = 0