Yash Sir Sanchit Sir: Visit Our Website
Yash Sir Sanchit Sir: Visit Our Website
Download KG App
main()
{
float me = 1.1;
double you = 1.1;
if(me==you)
printf("I love U");
else
printf("I hate U");
}
main()
{
static int var = 5;
printf("%d ",var--);
if(var)
main();
}
A. 1 3 2 5 8
B. 5 4 3 2 1
C. 5 8 9 6 4
D. Runtime Error
[HEXAWARE 2019]
main()
{
int c=- -2;
printf("c=%d",c);
}
A. c=2;
B. c=-2;
C. c=++2;
D. Runtime Error
[WIPRO 2020]
Explanation : Float takes 4 bytes and long double takes 10 bytes. So float stores
0.9 with less precision than long double.
Ans. b
Explanation : When static storage class is given, it is initialized once. The change
in the value of a static variable is retained even between the function calls. Main
is also treated like any other ordinary function, which can be called recursively.
Ans. b
Explanation : extern int i; specifies to the compiler that the memory for i is
allocated in some other program and thataddress will be given to the current
program at the time of linking
Ans. a
Explanation : Here unary minus (or negation) operator is used twice. Same maths
rules applies, ie. minus * minus= plus.
KGYT
on