Você está na página 1de 8

C

1. void main()
{
char *s="\12345s\n";
printf("%d",sizeof(s));
}
The output of the program
a. 5
b. 6
c. 7

d. 8

2. main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
}
a. Compiler Errorb. 0, 20

c. Linker Error

3. main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
a. 57, 92
b. 55, 92

c. 57, 94

d. None

d. None

4. main()

{
int i;
clrscr();
printf("%d", &i)+1;
scanf("%d", i)-1;
}
a. RunTime Error. Access Violation
c. Cannot be determined

b. Compiler Error. Illegal syntax


d. None of the above

5. main()

{
int i = 0xff ;
printf("n%d", i<<2);
}
a. 4

b. 512

c. 1020

d. 1024

6. #define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}
a. 1
b. 225
c. 15

d. None of the above

7. main()
{
int i, j, *p;
i = 25;
j = 100;
p = &i; // Address of i is assigned to pointer p
printf("%f", i/(*p) ); // i is divided by pointer p
}
a. Runtime Error
b. 1.00000
c. Compile Error

d. 0.00000

8. main()
{
char * strA;
char * strB = I am OK;
memcpy( strA, strB, 6);
}
a. Runtime Error

c. Compile Error

d. I am O

9. How will you print % character?


a. printf(%)
b.printf(\%)

c. printf(%%)

d. printf(%%)

10. main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcat(a,b));
}
a. Hello
b. Hello World

c. Hello World

d. None of the above

11. void func1(int (*a)[10])

{
printf("Ok it works");
}
void func2(int a[][10])
{
printf("Will this work?");
}

b. I am OK

main()
{
int a[10][10];
func1(a);
func2(a);
}

a. Ok it works
c. Ok it worksWill his work?

b. Will this work?


d. None of the above

12. main()

{
int c = 5;
printf("%d", main||c);
}
a. 1

b. 0

c. Illegal use of pointer

d. None of the above

13. void main ()

{
int x = 10;
printf ("x = %d, y = %d", x,--x++);
}
a. 10, 10
above

b. 10, 9

c. 10, 11

d. None of the

C++
14. The number of instances for a Static Member Variable is
a. a) Equal to number of objects created b. 1
c. 0
d. None
15. A C++ class can have
a. Virtual Constructor
b. Virtual Destructor
c. Virtual Constructor and Destructor
d. None
16. A class that is used to traverse through the objects maintained by a
container class.
a. Iterator class
b. STL
c. Vector class
d. None
17. void main()
{
int a, *pa, &ra;
pa = &a;
ra = a;
cout <<"a="<<a <<"*pa="<<*pa <<"ra"<<ra ;
}

a. Compile Time Error

b. Run Time Error

c. No errors d. None

18. The characteristics of static member functions


a. It can't directly access the non-static members of its class
b. It is without this pointer
c. Both (a) and (b)
d. None
19. The sizeof a class, having only Member Functions is
a. 1
b. 0 c. Cannot be determined d. None
20. const int size = 5;
void print(int *ptr)
{
cout<<ptr[0];
}
void print(int ptr[size])
{
cout<<ptr[0];
}
void main()
{
int a[size] = {1,2,3,4,5};
int *b = new int(size);
print(a);
print(b);
}
a. 1, 1
b. RunTime Error

c. Compile Time Error

21. class A {
public:
// Line 1
int a=10;
// Line 2
float b;
// Line 3
double c;
// Line 4
void fun() { return b;}// Line 5
};
// Line 6
void main()
// Line 7
{
// Line 8
A a1;
// Line 9
a1.b=10;
// Line 10
cout << a1.fun();
// Line 11
}
// Line 12
a. Output is 10
b. Error at Line 9
22. class A
{
int a;
float b;
double c;
public:

d. None

c. Error at Line 1 d. None

int fun(int i) { return i;}


float fun(float f) { return f};
double fun(double d) { return d;}
};
void main()
{
A a1;
a1.fun(10.2);
}
a. Compile Error Ambiguity in function call
b. Runtime Error Program crash c. 10.2

d. None

23. When a language has the capability to produce new data type, it is called
a. Extensible b. Overloaded
c. Encapsulated
d.
Reprehensible
24. If Base Class, B is derived by Class D1 & D2, the constructor will be
called
a. B -> D1, B -> D2 b. B -> D1 -> D2 c. D2 -> D1 -> B
d. None of the above
25. A class that has no functionality of its own
a. Friend class b. Wrapper class c. Concrete class
above

d. None of the

26. class A
{
int a;
// Line 1
int b;
// Line 2
public:
// Line 3
void fun(int a,int b){ // Line 4
return a+b;
// Line 5
};
// Line 6
void main()
// Line 7
{
// Line 8
A a1;
// Line 9
cout << a1.fun(10,11);
// Line 10
}
a. Output is 21 b. Error at Line 9 c. Error at Line 4 d. Error at Line 8
Operating Systems
27. Which of the below version is a Multitasking OS?
a. Win 95 b. Win 98
c. Win NT d. Win ME

28. What is the difference between Virtual memory and Swapping

a. virtual memory used to store a part of process in


memory whereas swapping can either put in entire
process memory or out.
b. swapping used to store part of a process
c. Both are same
d. Both are different concepts used to resolve different problems
29. Which one of the following can't be used to find an Internet address
given the
domain name?
a. /etc/host
b. NIS yellow pagesc. DNS
d. ARP
30. The very first process created by the kernel that runs till the kernel
process halts is
a. getty
b. init
c. fork
d. None
31. What is measure of reliability for a computer based system if
MTBF=mean time
between failure, MTTF=mean time to failure and MTTR=mean time to
recover?
a. MTBF=MTTF/MTTR
b. MTBF=MTTF*MTTR
c. MTTR=MTTF*MTBF
d. MTBF=MTTF+MTTR
32. What algorithm does UNIX and windows use to deal with deadlocks?
a. Kernel algorithm
b. Ostrich algorithm
c. Both
d.
None
33. What is socket ? How many required to make connection between two
systems?
a. A socket is 2-tuple having protocol and port number and requires 4
sockets
b. A socket is 3-tuple having protocol address and port number and
requires 4
sockets
c. A socket is 2-tuple having protocol and address and requires 2 sockets
d. A socket is 3-tuple having protocol address and port number
and
requires 2 sockets
Communications
34. The GSM system is the most widely used mobile telecommunications
system in use
in the world today. The letters GSM originally stood for the words ______?
a. Global Speciale Mobile Communications
b.Groupe Speciale
Mobile

c. Global System for Mobile Communications


Mobile

d. Group System for

35. Transmission Control Protocol (TCP) is implemented in the __________


layer of the
TCP/IP model.
a. Network
b. Transport
c. Application
d.
Physical

36. The signal bandwidth for the communications channel needed depends
on the
________, not on the ___________.
a. Symbol rate, bit rate b. Bit rate, symbol rate.
c. Bit rate, baud rate
d. Baud rate, symbol rate
37. WCDMA stands for
a. WideBand Code Division Multiplexing Access
b. Wide Code Division Mutliple Access.
c. Wideband Code Division Multiple Access
d. None of the above.
38. Digital cable television uses
a. BPSK b. AM
c. FM

d. QAM

39. A specific implementation of OOK (On-Off Keying) is


a. Morse Codeb. Mobile code
c. Digital Signature d. None of
the above.
Networking
40. UDP has which of the following characteristics:
a. Three-way handshake for connection establishment.
b. Connection state at the server.
c. Regulated send rate.
d. Checksum for error detection.
41. Which of the following is used to contain an Internet standard?

a. RFC

b. IETF

c. DNS

d. PPP

42. Which of the following provides a connection-oriented transport service?


a. TCP
b. UDP.
c. IP.

d. HTTP.
43. Which of the following approaches to switching share network resources?
a. Circuit switching.
b. Packet Switching
c. Both
d. None of the above.
44. All web servers use port 80 to listen for client requests.
a. True b. False
45. Which of the following helps improve the performance of DNS?
a. Its distributed nature. b. Iterated requests. c. Caching. D. All the above

46. The transport layer is used to provide:


a. Logical communication between processes.
b. Logical communication between hosts.
c. Logical communication between adjacent network entities.
d. All of the above.
47. What is the method of connecting two physically separate LAN by using
internet?
a. PSTN
b. VPN
c. iLAN
d. WAN
48. Operation of queue
a. FIFO
b. LIFO

c. FILO

49. Which is a type of primary memory?


a. RAM and ROM
b. HDD
these

d. none of these
c. CDROM

50. For mobile communication


a. downlink freq > uplink freq b. uplink > downlink
d. equal

d. none of

c. none