High Level and Procedural
Low Level and OOPS
Middle Level and Procedural
Machine Level and OOPS
A. High Level and Procedural
main()
{
int sub[50];
for(i=0; i<=48;i++)
{
sub[i]=i;
printf("
%d", sub[i]);
}
}
0 to 48 will be displayed
48
49
Compilation Error
the increment should always be ++k
the variable must always be the letter i when using a for loop
there should be a semicolon at the end of the statement
the commas should be semicolons
void main()
{
int a = 20;
printf("%d\t%d
", ++a, a);
}
21 21
20 21
21 20
20 20
void main()
{
int a = 0;
while (a<=50) for(;;) if(++a % 50==0) break;
printf("a = %d", a);
}
a = 100
a = 50
compilation error
runtime error
3.4e38 to 3.4e38
32767 to 32768
32768 to 32767
32668 to 32667
True
False
printf("%d%d", book.price, book.page);
printf("%d%d", price.book, page.book);
printf("%d%d"< price::book< page::book);
printf("%d%d", price>book, page>book);
main()
{
xyz: goto abc;
printf("Hello");
abc: printf("World");
goto xyz;
}
Infinite loop
Hello World
World Hello
Compilation error
True
False
True
False
**, * or /, + or -
**, *, /, +, -
**< /< *< +<-
/ or *, - or +
True
False
string.h
strings.h
text.h
strcmp.h
True
False
They begin with a hash symbol
They are processed by a preprocessor
They form an integral part of the code
They have to end with a semi colon
Sequential
Random
Sequential and Random
None of the above
True
False
''
" "
'a'
abc'
An Editor
A compiler
An operating system
None of the above
double and chars
floats and doubles
ints and floats
ints and chars
const X* const
X* const
X*
X&
1 byte
4 bytes
8 bytes
16 bytes
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
True
False
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
main()
{
int k, num = 30;
k = (num > 5 ? (num <= 10 ? 100 : 200) : 500);
printf("
%d", num);
}
200
500
30
Unpredictable
void change (char *k)
{
k="Hello";
return;
}
main()
{
char *ch = "World";;
change(ch);
printf("%s", ch);
}
Hello
World
Compilation error
Hello World