What will be output if you will compile and execute the following c code?
#include
int main(){
char c=125;
c=c+10;
printf("%d",c);
return 0;
}
135
+INF
-121
-135
C. -121
As we know char data type shows cyclic properties i.e. if you will increase or decrease the char variables beyond its maximum or minimum value respectively it will repeat same value according to following cyclic order:
So,
125+1= 126
125+2= 127
125+3=-128
125+4=-127
125+5=-126
125+6=-125
125+7=-124
125+8=-123
125+9=-122
125+10=-121
void main()
{
float a;
int x = 10, y = 3; a = x / y;
printf("%f", a); }
3.999999
Error
3
3.000000
True
False
\a
\b
\m
for
while
do-while
while & do-while
Dennis Ritchie
Ken Thompson
Bill Gates
Peter Norton
True
False
Work same as printf()
prints the error message specified by the compiler
prints the garbage value assigned by the compiler
None of the above
main()
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("
%d", num);
}
200
500
30
Unpredictable
True
False
True
False
1 byte
4 bytes
8 bytes
16 bytes
True
False
True
False
string.h
strings.h
text.h
strcmp.h
True
False
std::vector
std::list
std::map
std::set
do-while
if-else
goto
for
True
False
True
False
True
False
True
False
int ~Country()
void Country()
int ~Country(Country obj)
void ~Country()
Overloading is a dynamic or run-time binding and Overriding is static or compile-time binding
Redefining a function in a friend class is called function overriding while Redefining a function in a derived class is called a overloaded fucntion.
Overloading is a static or compile-time binding and Overriding is dynamic or run-time binding
Redefining a function in a friend class is called function overloading while Redefining a function in a derived class is called as overridden fucnion.
True
False
91
88
90
89
**, * or /, + or -
**, *, /, +, -
**< /< *< +<-
/ or *, - or +
True
False
/ + *
* / +
+ / *
* / + -
Keywords have some predefine meanings and these meanings can be changed.
Keywords have some unknown meanings and these meanings cannot be changed.
Keywords have some predefine meanings and these meanings cannot be changed.
None of the above
True
False