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 ? | 25 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 ? | 11 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 / 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 ? | 1 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 / 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 |
Program to display given 3 integers in ascending order
#include<stdio.h> int main() { int i=2; int j=++i + ++i + i++; printf("%d\n",i); printf("%d\n",j); }
What is difference between class and structure?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10
Can an array be an Ivalue?
What is the most efficient way to store flag values?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
while initialization of two dimensional arrays we can initialize like a[][2] but why not a[2][] is there any reason behind this?
What does %p mean?
what is difference between declaring the pointer as int and char in c language?
What is the process of writing the null pointer?
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?