No student devices needed. Know more
20 questions
Memory allocation using malloc() is done in?
static area
Heap area
Stack area
Disc
What will be the use of void pointer?
Pointer will not return any value.
Address of any variable of any data type can be assigned.
Address of void method can be stored.
Address of another pointer can be stored.
What will be the output of the program given below?
#include<stdio.h>
int main()
{
printf(“%.0f”,5.89);
return 0;
}
0
5
6
5.89
How many times the loop will be executed?
#include <stdio.h>
Int main()
{ Int x,y;
for(x=5;x>=1;x--)
{
for(y=1;y<=x;y++)
{
printf(“%d\n”,y);
}
}
return 0;
}
15
11
10
13
What will be the output/error?
int main()
{
int i =5;
char c = ‘c’;
int sum = i+c;
printf(“%d”,sum);
return 0;
}
104
103
Error
-121
What will be the output of the following program?
main()
{
static int var = 5;
printf(“%d”,var--);
if(var)
main();
}
12345
012345
543210
54321
Find the output of the below Program?
main()
{
int i = 65;
printf(“sizeof(i)=%d”,sizeof(i));
}
sizeof(i)=1
sizeof(0)=1
sizeof(1)=1
sizeof(i)=2
Bitwise operators can operate upon ?
doubles and chars
floats and doubles
ints and floats
ints and chars
What is Dequeue?
Elements can be added from front
Elements can be added to or removed from both front and rear
Elements can be added from rear
Elements are removed from rear
What will be the output of the following arithmetic expression?
5+3*2%10-8*6
-37
-42
-32
-28
Which will legally declare and initialize an array?
int [] myList = {"1", "2", "3"};
int [] myList = (5, 8, 2);
int myList [] [] = {4,9,7,0};
int myList [] = {4, 3, 7};
Which one of the following will declare an array and initialize it with five numbers?
Array a = new Array(5);
int [] a = {23,22,21,20,19};
int a [] = new int[5];
int [5] array;
What will be the output of the program?
Public class Foo
{
public static void main(String[] args)
{
try
{
return;
}
finally
{
System.out.println( "Finally" );
}
}
}
Finally
Compilation fails
The code runs with no output
An exception is thrown at runtime.
Which of these access specifiers can be used for an interface ?
Public
Private
protected
All the Above
Choose the correct remarks.
C++ allows any operator to be overloaded.
Some of the existing operators cannot be overloaded.
Operator precedence cannot be changed.
None of the above
Which of the following operators cannot be overloaded?
>>
?:
.
Both B and C
The concept of multiple inheritance is implemented in java by
i) Extending two or more classes
ii) Extending one class and implementing one or more interfaces
iii)Implementing two or more interfaces
only (ii)
(i) and (ii)
(ii) and (iii)
only (iii)
A process that involves recognizing and focusing on the important characteristics of a situation or object is known as:
Encapsulation
Polymorphism
Abstraction
Inheritance
In object-oriented programming, new classes can be defined by extending existinG classes.This is an example of:
Encapsulation
Interface
Composition
Inheritence
To prevent any method from overriding, we declare the method as
static
const
Final
none of the above.
Explore all questions with a free account