main()
{int a=200*200/100;
printf("%d",a);
}
Answers were Sorted based on User's Feedback
Answer / vishi
200*200=40000;
as the range of int(-32768 to +32767)
40000 exeeds +32767 &hence goes to the other side,
40000-32767=7233;
now (-32768+7233)=(-25535);
hence the value of 40000 will be -25535;
result be (-25535/100)="-255"(integer value).
Is This Answer Correct ? | 24 Yes | 2 No |
Answer / pravin
200*200=40000;
as the range of int(-32768 to +32767)
40000 exeeds +32767 &hence goes to the other side,
40000-32767=7233;
now (-32768+7233)=(-25535);
hence the value of 40000 will be -25535;
result be (-24435/100)="-244"(integer value).
thank u
Is This Answer Correct ? | 26 Yes | 10 No |
Answer / deepak roniya
explanation 7 is right......i also run this program and the
result is -255
Is This Answer Correct ? | 10 Yes | 1 No |
Answer / vivek shah
because
int range 32767 to -32768
200*200=4000;
so out of range
-255
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / tanvi jain
200*200=40000;
as the range of int(-32768 to +32767)
40000 exeeds +32767 &hence goes to the other side,
40000-32767=7233;
now (-32768+7233)=(-25535);
hence the value of 40000 will be -25535;
result be (-25535/100)="-255"(integer value).
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / shafi
int a=200*200/100;/*it is related with assignment operator so
it's right->left shift*/
=200*2;
=400;
the value of a=400
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / xxxxxxx
among '* ','/' arithematic operators / has a higher
precedence.so 200/100 is enclosed in brackets and multiplied
with 200
so a=200*(200/100)=200*2=400
Is This Answer Correct ? | 0 Yes | 1 No |
can you change name of main()?how?
What is a struct c#?
to find the program of matrix multiplication using arrays
i want to job in your company, so how it will be possible.
Write a program that will read the input of any number of digits n in a row of shafh showing the breakdown of the printing and printing figures by the recursive function.
Explain how can I right-justify a string?
how to implement stack operation using singly linked list
Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.
What is the data segment that is followed by c?
What does printf does?
How can I remove the trailing spaces from a string?
What is console in c language?