fork(1) download
  1. #include <stdio.h>
  2.  
  3. main() {
  4.  
  5. int num1=18, num2=9;
  6. float decimal1=2.5, decimal2 1.5;
  7.  
  8. printf("18/9 = %d\n\n", num2/num1);
  9. printf("1.5/2.5 = %.3f\n\n", decimal2/decimal1);
  10. printf("3+6*10 = %d\n\n", 3+6*10);
  11. printf("(3+6)*10 = %d\n\n", (3+6)*10);
  12.  
  13. return 0;
  14. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:3:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main() {
 ^
prog.c: In function 'main':
prog.c:6:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant
 float decimal1=2.5, decimal2 1.5;
                              ^
prog.c:9:30: error: 'decimal2' undeclared (first use in this function)
 printf("1.5/2.5 = %.3f\n\n", decimal2/decimal1);
                              ^
prog.c:9:30: note: each undeclared identifier is reported only once for each function it appears in
stdout
Standard output is empty