fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. return 0;
  6. }// Developer: Faculty CMIS102
  7. // Date: Jan 31, 2014
  8. #include <stdio.h> int main ()
  9. {
  10. /* variable definition: */
  11. int a, b, c; float f, g1, g2, h1, h2;
  12. /* variable initialization */
  13. a = 10; b = 20;
  14. f = 75.0; g1 = 3.0;
  15. g2 = 0.0;
  16.  
  17. // Calculate sum of a and b c = a + b;
  18. //Note: a,b,c are Declared as Integer, hence we use %d as the formatter. //Wherever you put the formatter symbol (i.e %d) is where the variable value is substituted. //The order of the substitution is the same as the order of the variable list at the end (a,b,c) //Note the tab (\t) in the statement also. printf(" The sum of Integers (%d) and (%d) is : \t %d \n", a, b, c); // value of a is substituted here ^ value of b ^ value c ^ here
  19.  
  20. // Calculate quotients
  21. h1 = f/g1;
  22. h2 = f/g2;
  23.  
  24. //Note: f,g,h are Declared as Float, hence we use %f as the formatter. printf(" The number (%f) divided by (%f) yields the quotient (%f) \n", f, g1, h1);
  25.  
  26. printf(" The number (%f) divided by (%f) yields the quotient (%f) \n", f, g2, h2);
  27.  
  28. return 0;
  29. }
  30.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:8:20: warning: extra tokens at end of #include directive
 #include <stdio.h> int main ()
                    ^~~
prog.c:9:1: error: expected identifier or ‘(’ before ‘{’ token
 {
 ^
stdout
Standard output is empty