0% found this document useful (0 votes)
9 views

13 Pseudo Code

The document contains a series of multiple-choice questions and answers related to programming concepts, data structures, and algorithms. Topics covered include loops, linked lists, C++ functions, network security, encryption algorithms, and pseudocode constructs. Each question is followed by its correct answer, providing a quick reference for understanding fundamental programming principles.

Uploaded by

maanniissh45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

13 Pseudo Code

The document contains a series of multiple-choice questions and answers related to programming concepts, data structures, and algorithms. Topics covered include loops, linked lists, C++ functions, network security, encryption algorithms, and pseudocode constructs. Each question is followed by its correct answer, providing a quick reference for understanding fundamental programming principles.

Uploaded by

maanniissh45
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

1.which loop is guaranteed to execute at least one time?

a.for
b.while
c.do while
d.None of above

ANSWER:B

2.The concatenation of two list can performed in O(1) time. Which of the following variation of linked
list can be used?
a.single linked list
b.Doubly linked list
c.Circular doubly linked list
d.arry implementation of list
ANSWER:C
3.What will be the output of the following C++ code?

#include <iostream>

109

using namespace std;

void fun(int x, int y)

{ x = 20; y = 10;

int main()

{ int x = 10:
fun (x, x);
A.10
B.20
C.COMPILE TIME ERROR
D.NONE OF THE ABOVE
AMSWER:A

4.Goto can be used to jump from main to within a function?


A.true
B.false
c.may be
d.cant say
ANSWER:B
5.How is linked list implemented?

a.Through nodes

b.Through structure

c.Through referential Structures

d.None of these
ANSWER:B
6.Which of the following operator takes only integer operands?
A.+
b.*
c./
d.%
ANSWER:D
7.Where does the execution of the program starts?
a.user defined function
b.main function
c.void function
d.eise functiom
ANSWER:B
8.What will be the value of y if x=8?y=(x>6?4:6);
a.4
b.6
c.0
d.compile error
ANSWER:A
9. A is a directed graph that describes the flow of execution control of the program.
a.Flowchart
b.Flow graph
c.Complexity curve
d.Algorithm
ANSWER:A
10.THE continue statement cannot be used with-----------?
a.for
b.While
c.do While
d.switch
ANSWER:D
11.----------.provides virtual machines, virtual storage, virtual infrastructure, and other hardware assets.
a.SaaS
b.PanS
c.All of the mentioned
d.laas
ANSWER:D
12.Which of the following is the default return value of function in C++?
a.char
b.int
c.void
d.float
ANSWER:b
13. In network security, what does IDS stand for?
a.Internet Data Service
b.Intrusion Detection System
c.Internet Denial Service
d.Internet Data Server
ANSWER:B
14. Which encryption algorithm is commonly used for secure data transmission over the Internet?
A.RSA
B.DES
C.MDS
D.SQL
ANSWER:A
15.DES Stands for?
a.Data Encryption Standard
b.data encryption statistics
c.data encryption system
d.data encryption sequence
ANSWER:A
16. Which type of malware disguises itself as a legitimate program to trick users into installing it?
A.Worm
B.Trojan
C.Spyware
D.Rootkit
ANSWER:B
17. Which is the most essential concept related to Cloud computing?
A.Abstraction
B.Reliability
C.Productivity
D.All of the mentioned
ANSWER:A
18. What type of malware is designed to spread from computer to computer and can replicate itself?
A.O Spyware
B.Worm
C.Trojan
D.OAdware
ANSWER:B
19. The process of converting readable text into unreadable characters for security is called
a.Decryption
b.Encoding
c.Encryption
d.Hashing
answer:c
20. What does IEEE 802.11 refer to?
a.Biuetooth standard
b.Wireless networking standard
c.Ethernet standard
d.Fiber optic standard
ANSWER:B
21. What is the term for a chart that illustrates the flow of functions or processes without displaying any actual
code?
A.Aflowchart
B.Structure chart
C.Both A and B
D.None
ANSWER:A
22. How should you position default parameters within a C++ function prototype?

A.To the rightmost side of the parameter list


B.To the leftmost side of the parameter list
C.Anywhere inside the parameter list
D.Middle of the parameter ast
ANSWER:A
23. Which loops are typically created in the C programming language?
A.While Block
B.For Block
C.Do While Block
D.All the above
ANSWER:D
24. Which logical operator does not allow us to combine two or more conditions?
A.O AND
B.OR
C.NOT
D.ONAND
ANSWER:C
25. Which type of operator takes two operands?
A.Unary operator
B.Binary operator
C.ternary operator
D.None of them
ANSWER:B
26. What will be the output of the following C++ code?

#include <iostream>

using namespace std:

void fun(int x, int y) (

x=20;
y = 10;
}
int main() (
int x = 10:
fun(x, x):
cout <<x
return 0;
}
A.10
B.20
C.0
D.Compile
ANSWER:A
27. Which of the following is the default return value of functions in C++?
a.char
b.int
c.void
d.float
answer:b

28.which of the following pseudocode lines correctly assigns the values

options
a. Count =5
b. 5 = count
c. 5 -> count
d. Count ->5
Answer A
29.Which keyword is typically used to call a function in pseudocode ?

a. Start
b. Execute
c. Call
d. Run
Answer C

30.What different the “ And “ operator from the “ And Also” operator
a. The “ And “ operator uses shorthand evaluation, while the “ And Also
b. The “ And “ operator uses short- evaluation, while the “ And Also
c. The “ And “ operator uses short evaluation, while the “ And Also operator
d. The “ And “ operator and the “AndAlso” operator have the same evaluation
Answer B

31.What is the value of the integer variable a in the c++ statement int a= 3.5 +4.5

a. 0
b. 7
c. 8
d. 8.0
Answer C
32.What is the output of the following pseudocodes snippet ?
….
X=1
While x <10 do
X= x +3
Print x
End while
…….
a. 1,4,7,10
b. 4,7,10
c. 1,3,6,9
d. 1,3,5,7,9
Answer B

33.What are the values of the variables (a,b,c and d ) after the following
Float a =5/2
Float a =5/2.0
Float a =5.0/2
Float a =5.0/2.0

a. a=2, b=2.5, c=2.5, d=2.5


b. a=2, b=2.5, c=2.5, d=0
c. a=2.0, b=2.5, c=2.5, d=2.5
d. a=2.0, b=2.5, c=2.5, d=2.0

Answer C
34.A data structure that follows the FIFO principal _______
a. Queue
b. LL
c. Stack
d. Union

Answer A

35.Which data types can be accepted by a switch statement in c++

a. Int
b. Char
c. Long
d. All the above
Answer D

36.What will be the output of the following pseudocode for a=2

Do Something ( integer a ,integer b )


If ( b EQUALS )
return 0
else
return a+ doSomething ( a,b-1)
End function doSomething()
a.3
b.4
c.2
d.1

Answer B

37.which of the following pseudocode constructs is used to repeat a statement


a. If -else statement
b. Function call
c. Loop statement
d. Assignment statement
Answer C

38.In C, what is the relationship between the “ if “ statement and the if else statement

a. else if is compulsory to use with the “if statement


b. else is compulsory to use with the “if statement
c. “else” or” else if “is compulsory to use with the “if statement
d. None of the above
Answer C

39.______________ is used to show hierarchy in a pseudo code

a. Indentation
b. Curly braces
c. Round brackets
d. Semicolon

Answer A

40.What will be the output of the following c program ?


Int main () {
Int a= 0;
a = 5 > 2 ? printf(“4) : 3;
return 0;
}
a. 4
b. 3
c. 43
d. Complie Error

Answer C

41.A statement used to close the IF block is _________


a. ELSE
b. ELSEIF
c. END
d. ENDIF

Answer B

42.Which operator true if any of the sub-conditions is true ?


a. AND
b. NAND
c. XOR
d. OR

Answer D

43.How many times the shop will execute ?


For( int i =0 ; i<10 ; (++)
{
i = i*2;
i--;
}

a.10
b. 5
c.0
d . infinite
Answer D

44.What is the output of the following code snippet ?


#include < studio.h>
Int main () {
Int a []= { 1,2,3,4 } ;
Int sum =0;
For(int i=0; i < 4 ; i ++ ) {
Sum + = a [i];
}
Printf(*%d”,sum);
return 0;
}
a. 1
b. 4
c. 20
d. 10
Answer D
45.In which of the following scenarios may inline functions not word

a. When the function has static variable


b. When the function has global and register variable
c. When the function contains loops
d. When the function is recursive

Answer D

46. What is the standard way to denote the assignment of a value to a variable ?

a. =
b. ;=
c. ==
d. =>

Answer C
47.What is the result of a logical or relational expression in C
a. 0 or 1
b. True or false
c. 0 if false and a positive number if true
d. T or F
Answer A

48.The keyword used to transfer control from a function back to the function is ______

a. Switch
b. goto
c. go back
d. return
Answer D
49.what are the purpose or applications of functions ?
a. it helps to avoid repeating a set of statement many times
b. it enhance the logical clarity of the program
c. it makes the debugging task easier
d. all the above

Answer D

50.Output is an arithmetic expression with integers and number is ______ by default?

a. Integer
b. Real number
c. Depends on the number used in the expression
d. None of the above

Answer B

51.How many times ‘A’ will be printed in the following pseudocode ?


Integer a,b,c
For( a=0 to 4)
For (b = 0 to 2)
If ( a is greater than b )
Print ‘A’
End for
End for
End if

a. 8
b. 7
c. 9
d. 10

Answer C
52.What does the following pseudocode line represent ?
….while ( temperature > 100)
……
a. Execute the loop while temperature is less than 100.
b. Execute the loop while temperature is greater than 100
c. Execute the loop while temperature is equal to 100
d. Execute the loop once regarding of the temperature value

Answer B

53.Which of the following is an exit controlled loop ?


a. While loop
b. For loop
c. Do – while loop
d. None of the above

Answer C

54.Where does the execution of the program start ?


a. User defined function
b. Main function
c. Void function
d. Else function

Answer B

55.The code for C


# include
Int main ()
{
Int i=0
While (i < 3)
[ ++
Printf (“ in while loop/n”);
}
How many times “ i “ values checked

a. 4
b. 3
c. 2
d. 1

Answer A
Which pseudocode construct is used to make a decision between two or more alternatives?
a) Loop b) Function c) Call d) Conditional statement

You might also like