freetests4u.com

Online knowledge sharing platform

CDAC-CCAT section B Mock test -1 (15 questions, time 15 minutes)

1.
'C' is often called a ________

Object oriented language
High level language
Assembly language
Machine level language
None of these
2.
Which of the following is object oriented programming ?

C
C++
BASIC
FORTRAN
None of these
3.
The value that follows the keyword CASE may only be

constants
variable
semicolon
number
None of these
4.
Advantages of using flow charts is

Effective Analysis
Efficient Coding
Time consuming
Effective Analysis and Efficient Coding
Time Analysis
5.
A pointer variable can be

passed to a function as argument.
changed within function.
returned by a function.
assigned an integer value.
None of these
6.
Which of the following is true about recursive function ?

i. it is also called circular definition
ii. it occurs when a function calls another function more than once
iii. it occurs when a statement within the function calls the function itself
iv. a recursive function cannot have a return statement within it


i and iii
i and ii
ii and iv
i, iii and iv
None of these
7.
The output of this code is :
{
int a = 5;
int b = 10;
cout << (a>b?a:b);
}

5
10
20
Syntax error
None of the above
8.
What is the output of the following code ?

void main()
{
int i = 100, j = 200;
const int *p=&i;
p = &j;
printf("%d",*p);
}

100
200
300
400
None of the above
9.
The output of this code is :

main()
{
long i = 30000;
printf("%d", i);
}

3000
30000
0
-1
1
10.
What is the output of the following program code ?

#include<`stdio.h`>    (Please neglect `` this signs)
void abc(int a[])
{
a++;
a[1]=612;
}
main()
{
char a[5];
abc(a);
printf("%d",a[4]);
}

100
612
800
Error
None of these
11.
What is the output of the following code ?

#include<`stdio.h`>    (Please neglect `` this signs)
void main()
{
int arr[] = {10,20,30,40,50};
int *ptr = arr;
printf(" %d %d ",*ptr++,*ptr);
}

10 20
10 10
20 20
20 10
Error
12.
What would be the output of the following program ?
#include <`stdio.h`>    (Please neglect `` this signs)
main()
{
printf(" %c", "abcdefgh"[4]);
}

abcdefgh
d
e
error
None of these
13.
What is the output of the following program ?

#include <`stdio.h`>    (Please neglect `` this signs)
void main()
{
printf(" 10!=9 : %5d",10!=9);
}

1
0
-1
Error
None of these
14.
What is the output of the following code ?

#include<`stdio.h`>    (Please neglect `` this signs)
void main()
{
int a=14;
a += 7;
a -= 5;
a *= 7;
printf(" %d",a);
}

112
98
86
74
None of these
15.
#include<`stdio.h`>    (Please neglect `` this signs)
main()
{
int *p1,i=25;
void *p2;
p1=&i;
p2=&i;
p1=p2;
p2=p1;
printf("%d",i);
}

The output of the above code is :

25
Garbage value
Address of I
625
Program will not compile


CDAC CCAT Mock Tests

CDAC-CCAT test 1 (section A)

CDAC-CCAT test 2 (section A)

CDAC-CCAT test 3 (section A)

CDAC-CCAT test 4 (section A)

CDAC-CCAT test 5 (section A)

CDAC-CCAT English test (section A)

CDAC-CCAT test 1 (section B)

CDAC-CCAT test 2 (section B)

CDAC-CCAT test 3 (section B)

CDAC-CCAT test 4 (section B)