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


Please Help Members By Posting Answers For Below Questions

Do you know null pointer?

623


List some of the dynamic data structures in C?

795


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.

1640


List out few of the applications that make use of Multilinked Structures?

1315


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

3135






What is unary operator?

664


What is the function of volatile in c language?

671


Explain about block scope in c?

667


Why is a semicolon (;) put at the end of every program statement?

634


what is the diffrenet bettwen HTTP and internet protocol

1397


Explain how do you print only part of a string?

658


What does return 1 means in c?

592


how to execute a program using if else condition and the output should enter number and the number is odd only...

1665


What is the use of in c?

586


The statement, int(*x[]) () what does in indicate?

654