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 are Storage Classes in C ?
32 Answers CTS, HP, IBM, Maharaja Whiteline, Tamil Nadu Open University TNOU, TATA, TCS, Wipro,
Difference between exit() and _exit() function?
Write a program to generate prime factors of a given integer?
What is wrong with this statement? Myname = 'robin';
Reverse the bit order in a single macro. eg. i/p = 10010101 --> o/p = 10101001
what is the height of tree if leaf node is at level 3. please explain
What are the advantages of using linked list for tree construction?
What is preprocessor with example?
without a terminator how can we print a message in a printf () function.
How many types of arrays are there in c?
code for reverse alternate words from astring
Write a C++ program to give the number of days in each month according to what the user entered. example: the user enters June the program must count number of days from January up to June