Explanation : This statement is undefined behavior because the argument has to be of type double and 9 / 5 is of type int.
Following program yields an output of 1.8
int main()
{
printf("%f",9/5.0);
return 0;
}
Explanation : In the computer I used to execute this program. The output was 4294967293. That's because in my system,
sizeof (int ) is 4 bytes (32 bits), and negative numbers are represented in 2's complement form.
This means -4 will be represented as 11111111 11111111 11111111 11111100 (i.e. 30 one's followed by 2 zeroes).
Note that this number is 232 - 1 - 3. Before j gets added to 1, it will be converted to an unsigned integer. So, i + j is essentially adding 1 to 232- 1 - 3 which gives 4294967293.
Explanation : Let size of ( int ) = 1. So, -4 will be stored as 1 1 1 1 1 1 0 0.
Since we are adding unsigned and signed integers, the signed gets converted to unsigned.
So, i + j will become 1 1 1 1 1 1 0 1. We are trying to print this as an unsigned integer.
So, what is printed will be 28 - 1 - 2. So, log (x + 3) = 8 (i.e.. 8 * sizeof ( int)}.
input output operations in c Questions can be used to give quizzes by any candidate who is preparing for UGC NET Computer Science
This input output operations in c Questions section will help you test your analytical skills in a tricky method, thereby giving you an edge over other students
Any student who wants to prepare for DOEACC A Level, DOEACC B Level, and DOEACC C level can also use these Objective Type Questions Answer.
All candidates who have to appear for the Kendriya Vidyalaya Entrance exam can also refer to this mcq section.
You can also get access to the input output operations in c MCQ ebook.
input output operations in c Questions can be used in the preparation of JRF, CSIR, and various other exams.
You can also download pdf for these input output operations in c multiple-choice questions Answers.
This input output operations in c Multiple Choice Questions Answers section can also be used for the preparation of various competitive exams like UGC NET, GATE, PSU, IES, and many more.
input output operations in c Questions can be used to gain a credit score in various undergraduate and postgraduate courses like BSc, MSc and MCA
input output operations in c Questions for UGC NET Computer Science
input output operations in c MCQ
input output operations in c Multiple choice questions