the output will be
#include<stdio.h>
int main ()
{
int i;
i = 9/2;
printf("%i",i);
return 0;
}
Answers were Sorted based on User's Feedback
Answer / 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 |
What is the 'named constructor idiom'?
What are preprocessor directives in c?
write a progam to display the factors of a given number and disply how many prime numbers are there?
what is the difference between call by value and call by reference?
5 Answers Genpact, Global Logic, Infosys,
What is Conio.h ?
What is an array in c?
Write a c program to read a positive number and display it in words.? ex: 123=one two three help me....
What is maximum size of array in c?
write a c program to print a given number as odd or even without using loop statements,(no if ,while etc)
what is the structure pointer?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
What is difference between structure and union?