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
Do you know null pointer?
List some of the dynamic data structures in C?
The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.
List out few of the applications that make use of Multilinked Structures?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What is unary operator?
What is the function of volatile in c language?
Explain about block scope in c?
Why is a semicolon (;) put at the end of every program statement?
what is the diffrenet bettwen HTTP and internet protocol
Explain how do you print only part of a string?
What does return 1 means in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is the use of in c?
The statement, int(*x[]) () what does in indicate?