the output will be
#include<stdio.h>
int main ()
{
int i;
i = 9/2;
printf("%i",i);
return 0;
}
Answer Posted / jac
The output will be 4. The division is being stored in a variable of type int - division operations upon it will comport to the rules of integer division, which says, "Divide but drop the remainder". Moreover, the formatting flag "%i" prints an integer value all the time, even if you try and pass it a floating-point type (which will probably give you garbage - without a cast, that is).
http://www.cs.cf.ac.uk/Dave/C/node4.html - search "integer division"
http://linux.die.net/man/3/printf - look for the "i" formatting string
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is the difference between exit() and _exit() function in c?
What is difference between union and structure in c?
What is substring in c?
Define C in your own Language.
What are reserved words?
When can a far pointer be used?
What are the two types of functions in c?
Explain what is output redirection?
What does printf does?
How can a program be made to print the line number where an error occurs?
Why we not create function inside function.
How can I access an I o board directly?
What is gets() function?
What do mean by network ?
What are loops in c?