//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
// Calculate quotients
h1 = f/g1;
h2 = f/g2;
//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);
printf(" The number (%f) divided by (%f) yields the quotient (%f) \n", f, g2, h2);
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
{
^