Académique Documents
Professionnel Documents
Culture Documents
printf("Printing a float number:%f\n",y); // real printf("Printing a character:%c\n",c); // char printf("You can also print message prompts\n"); printf("Integer:%d\tFloat:%.1f\n",x, y); // printing tabs printf("Two decimals:%4.2f\nThree decimals:%6.3f\n",y,2*y); return(0); } Exercise 4: Write printf statements that print the following formatted numbers. The printout should be obtained from variables and not be hardcoded within the printf double quotations. For item 10, use a char variable to print the letter a. 1. x = nn125 2. y = n3.14 3. y+1 = 4.14 4. y = n3.141590 5. x + y = 6. x/5 = 7. x/100 = 8. x/y = 9. (2*x+1)%x = 10. a + 3.14