Technical Aptitude Question Paper for Practice :: #Campus Placement

Leave a Comment


  1.  #include<stdio.h>
int main()
{
char ch;
while (x=0;x<=255;x++)
printf("ASCII value of %d character %c\n", x, x);
return 0;
}
A. The code generates an infinite loop B. The code prints all ASCII values and its characters
C. Error: x undeclared identifier D. Error: while statement missing

  1. #include<stdio.h>
int main()
{
int i,
a[] = {2, 4, 6, 8, 10};
change(a, 5);
for(i=0; i<=4; i++)
printf("%d, ", a[i]);
return 0;
}
change(int *b, int n)
{
int i;
for(i=0; i<n; i++)
*(b+1) = *(b+i)+5;
}
A. 7, 9, 11, 13, 15 B. 2, 15, 6, 8, 10 C. 2 4 6 8 10 D. 3, 1, -1, -3, -5

3) #include<stdio.h>
int fun(int, int);
typedef int (*pf) (int, int);
int proc(pf, int,int);
int main()
{
printf("%d\n", proc(fun, 6, 6));
return 0;
}
int fun(int a, int b)
{
return (++a!=b++);
}
int proc(pf p, int a, int b)
{
return ((*p)(a, b));
}
A. 6 B. 1 C. 0 D. -1
4) main()
{
fork();
fork();
fork();
printf("Hello World!");
}
A. compiler error B. print hello world 4 time
C. print hello world 6 time D. print hello world 8 time

5) C program code –
int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap

A. 8 B. 9 C. 6 D. 12 E. 15

6) Virtual memory size depends on
A. address lines B. data bus C. disc space D. A & C E. None

7) What will be the output of the following program :
struct {
int i, val[25];
}var={1,2,3,4,5,6,7,8,9},*vptr=&var;
void main()
{
printf("%d %d %d\n",var.i,vptr->i,(*vptr).i);
printf("%d %d %d %d %d %d",var.val[4],*(var.val+4),vptr->val[4],*(vptr->val+4),
(*vptr).val[4],*((*vptr).val+4));
}
  1. Compile-Time Error B. 1 1 1 C. 1 1 1 D. None of these
666666 555555

8) What will be the output of the following program :
struct my_struct1{
int arr[2][2];
};
typedef struct my_struct1 record;
struct my_struct2{
record temp;
}list[2]={1,2,3,4,5,6,7,8};
void main()
{
int i,j,k;
for (i=1; i>=0; i--)
for (j=0; j<2; j++)
for (k=1; k>=0; k--)
printf("%d",list[i].temp.arr[j][k]);
}
  1. Compile-Time Error B. Run-Time Error C. 65872143 D. 56781243

9) What will be the output of the following program :
union A{
char ch;
int i;
float f;
}tempA;
void main()
{
tempA.ch='A';
tempA.i=777;
tempA.f=12345.12345;
printf("%d",tempA.i);
}
  1. Compile-Time Error B. 12345 C. Erroneous output D. 777

10) What will be the output of the following program :
struct A{
int i;
float f;
union B{
char ch;
int j;
}temp;
}temp1;
void main()
{
struct A temp2[5];
printf("%d %d",sizeof temp1,sizeof(temp2));
}
A. 12 60 B. 60 12 C. compile time error D. none

11) What will be the output of the following program?
void main()
{
static struct my_struct{
unsigned a:1;
unsigned b:2;
unsigned c:3;
unsigned d:4;
unsigned :6; // Fill out first word
}v={1,2,7,12};
printf("%d %d %d %d",v.a,v.b,v.c,v.d);
printf("%d ",sizeof v);
}
  1. 1 2 7 12 4 B. 12 7 2 1 2 C. compile time error D. none

12) What will be the output of the following program :
void main()
{
printf();
}
  1. Run-Time Error B. Compile-Time Error C. No Output D. None of these

13)What will be the output of the following program :
void main()
{
printf("%d",printf("Hi!")*printf("Bye"));
}
  1. ByeHi!6 B. Hi!Bye9 C. Hi!Bye D. None of these

14) What will be the output of the following program :
#define Compute(x,y,z) (x+y-z)
void main()
{
int x=2,y=3,z=4;
printf("%d",Compute(y,z,(-x+y)) * Compute(z,x,(-y+z)));
}
  1. 20 B. 30 C. 100 D. None

15)What will be the output of the following program :
void main()
{
int i;
float a[5];
for (i=0; i<5; i++)
a[i] = (printf, ("%d",i/10.0));
for (i=0; i<5; i++)
printf("%.1f ",a[i]);
}
  1. Compile-Time Error B. 0.0 0.0 0.0 0.0 0.0 C. 0.0 0.1 0.2 0.3 0.4 D. 1.0 1.0 1.0 1.0 1.0

16) What will be the output of the following program :
int * func()
{
int temp=50;
return&temp;
}
void main()
{
int *val;
val = func();
printf("%d",*val);
}
  1. Compile-Time Error B. 50 C. Garbage Value D. None of these

17) What will be the output of the following program :
void main()
{
long double val;
printf("%d bytes",sizeof(val));
}
  1. Compile-Time Error B. 4 bytes C. 8 bytes D. 10 bytes

18) What will be the output of the following program :
#define Loop(i) for (j=0; j<i; j++){ \
sum += i+j; \
}
void main()
{
int i,j,sum=0;
for (i=0; i<=3; i++)
Loop(i)
printf("%d",sum);
}
  1. Run-Time Error B. Compile-Time Error C. 18 D.0

19) What will be the output of the following program :
void main()
{
int i;
for (i=5; ++i; i-=3)
printf("%d ",i);
}
  1. 6 4 2 B. Compile-Time Error C. 6 3 1 D. Infinite Loop


20) What will be the output of the following program :
void main()
{
static int j;
for (j<5; j<5; j+=j<5)
printf("%d",j++);
}
  1. 024 B. Compile-Time Error C. 01234 D. No Output

21) What will be the output of the following program :
void main()
{
for (;printf(""););
}
  1. Compile-Time error B. NO OUTPUT C. Executes INFINITELY D. None of these

22) What will be the output of the following program :
void main()
{
static int choice;
switch(--choice,choice-1,choice-1,choice+=2)
{
case 1:
printf("Choice1");
break;
case 2:
printf("Choice2");
break;
default:
printf("Default");
}
}
  1. Choice1 B. Choice2 C. Default D. Compile error

23) What will be the output of the following program?
int funct(char ch)
{
ch=ch+1;
return ch;
}
void main()
{
int a=127;
printf("%d %d",a,funct(a));
}
  1. Compile-Time Error B. 127 128 C. 127 -128 D. None of these

24)What will be the output of the following program :
int funct1(int a)
{
if (a)
return funct1(a--)+a;
else
return 0;
}
void main()
{
int a=3;
printf("%d",funct1(a));
}
  1. 3 B. 6 C. 0 D. stack overflow

25) What will be the output of the following program :
void main()
{
int (*a)[5];
printf("%d %d",sizeof(*a),sizeof(a));
}
  1. Compile-Time Error B. 2 10 C. 4 20 D. 20 4

26) What will be the output of the following program :
void main()
{
int val=77;
const int const *ptr=&val;
printf("%d",*ptr);
}
  1. Compile-Time Error B. Run-Time Error C. 77 D. None of these

27)What will be the output of the following program :
void main()
{
char str[]="yagyesh kumar mishra";
printf("%d",++(sizeof(str)));
}
  1. 14 B. Compile-Time Error C. 15 D. run-time error

28) What will be the output of the following program :
void main()
{
int a=1,b=2,c=3;
c=(--a,b++)-c;
printf("%d %d %d",a,b,c);
}
  1. 0 3 -3 B. Compile-Time Error C. 0 3 -1 D. 0 3 0

29) What will be the output of the following program :
#define swap(a,b) temp=a; a=b; b=temp;
void main()
{
static int a=5,b=6,temp;
if (a > b)
swap(a,b);
printf("a=%d b=%d",a,b);
}
  1. a=5 b=6 B. a=6 b=5 C. a=6 b=0 D. None of these

30) What is the difference between class and structure?

_____________________________________________________________________________________
31) Write a macro "SWAP(a,b)" for swapping integers using bit wise operator XOR.

_____________________________________________________________________________________
32)What is virtual function?

_____________________________________________________________________________________
33) - ls command stores contents in
A. inode block B. process table C. directry entry D. current directory

34) startup programme of window : autoexec.bat :: startup program of Unix : ?
A. .profile B. autoexeclp C. getty D. csh

35) Semaphore is used for _____________________of multiple process

36) FTP transfer file with user authentication. (TRUE/FALSE)

37) In signed magnitude notation what is the minimum value that can be represented with 8 bits
A. -128 B. -255 C. -127 D. 0

38) abcD+abcd+aBCd+aBCD
then the simplified function is –
( Capital letters are copliments of corresponding letter for eg.A is compliment of a)
Hint - use boolean arithmatic.
A. a B. abc C. abcd D. a(bC+Bc) E. a(bC +BC)

39) A 12 address lines maps to the memory of_________
A. 1k bytes B. 0.5k bytes C. 4k bytes D. None

40). What does DLL stands for ?
A. Dynamic Language Library B. Dynamic Link Library
C. Dynamic Load Library D. None of the above

41) SNAPSHOT is used for
A. Synonym B. Table space C. System server D. Dynamic data replication

42. A Transaction ends
A. Only when it is Committed B. Only when it is Rolledback
C. When it is Committed or Rolled back D. None of the above


43) A Database Procedure is stored in the Database
A. In compiled form B. As source code C. Both A & B D. Not stored

44) A Stored Procedure is a
A. Sequence of SQL or PL/SQL statements to perform specific function
B. Stored in compiled form in the database
C. Can be called from all client environmets
D. All of the above

45) Which of the following is NOT VALID in PL/SQL ?
A. Select ... into B. Update C. Create D. Delete

46) What are the different events in Triggers ?
A. Define, Create B. Drop, Comment C. Insert, Update, Delete D. All of the above

47)Which layer in the OSI model handles terminal emulation ?
A. Session B. Application C. Presentation D. Transport E. Network

48).An internet IP address of a node has to be unique for
A. domain of the node B. country C. sub-network of the node D. World-wide E. None

49) Modem stand for
A. Modulator/demodulators
B. Connect to multiple computers
C. Broadcast wireless signals
D. Only work with AOL

50) TCP is a connectionless protocol. TRUE/FALSE

0 comments:

Post a Comment