You are on page 1of 13

Question 1

Complete
Marked out of 1.00
Flag question

Question text
1- Analyzing , 2- Implementing, 3- Planning, 4- TestingWhat is correct order a programmer
should follow?

a.
3, 2, 1, 4
b.
3, 1, 2, 4
c.
1, 3, 2, 4
d.
1, 2, 3, 4
Feedback
The correct answer is: 1, 3, 2, 4

Question 2
Complete
Marked out of 1.00
Flag question

Question text
Choose incorrect statement(s)

a.
A C program will start at main() function
b.
A C function is wrapped by curly braces.
c.
in C, comment lines are blocked by /* and */
d.
A C statement is terminated by a colon.
Feedback
The correct answer is: A C statement is terminated by a colon.

Question 3
Complete
Marked out of 1.00
Flag question

Question text
........software development model(s) has (have) some phases that are concurrently carried
out.
a.
None of the others.
b.
Waterfall and practical
c.
Practical
d.
Waterfall
Feedback
The correct answer is: Practical

Question 4
Complete
Marked out of 1.00
Flag question

Question text
Flag variables must be used in jumping statements (goto, continue, break statements).

a.
False
b.
True
Feedback
The correct answer is: False

Question 5
Complete
Marked out of 1.00
Flag question

Question text

Study three following code segments 1)CHAR S[50]= "ABCD";PUTS(S);(2)CHAR S[50]=


"ABCD";PRINTF("%S",S);(3)CHAR S[50]= "ABCD";PRINTF("%S\N",S);

a.
(1) and (2) have the same output.
b.
(1) and (3) have the same output.
c.
All of them have different outputs.
d.
(2) and (3) have the same output.
Feedback
The correct answer is: (1) and (3) have the same output.
Question 6
Complete
Marked out of 1.00
Flag question

Question text
int n=12345;How many bytes in a text file will store the value of n ?

a.
2
b.
7
c.
5
d.
4
e.
6
Feedback
The correct answer is: 5

Question 7
Complete
Marked out of 1.00
Flag question

Question text
Name of algorithms for searching an element in an array?

a.
bubble search and binary search
b.
binary search, and selection search
c.
linear search, bubble search, selection search
d.
Linear search, binary search
e.
masking, flagging
Feedback
The correct answer is: Linear search, binary search

Question 8
Complete
Marked out of 1.00
Flag question
Question text
Given S is a string variable and the function call fflush(stdin) will clear the input buffer.
What code in the followings will allow user input a string certainly?

a.
fflush(stdin) ; gets(S);
b.
gets(S)
c.
get(S);
d.
puts(S)
Feedback
The correct answer is: fflush(stdin) ; gets(S);

Question 9
Complete
Marked out of 1.00
Flag question

Question text
/* Suppose that all needed libraries are included */int main() { int n, m; int result =
scanf("%d%d",&n, &m); printf("%d", result); getch(); return 1;}What is the ouput of the
above program if input is 12asd45 ?

a.
1
b.
3
c.
2
d.
a non-predictable value.
e.
An error is thrown when it executes.
Feedback
The correct answer is: 1

Question 10
Complete
Marked out of 1.00
Flag question

Question text
Study the function:int t(int* a, int n) {for (int i=0; i<n/2; i++)if (a[i]!=a[n-1-i]) return 0;return
1;}int b[6] = { 1, 2, 3, 3, 2, 1};The statement T(B, 6) will return ….
a.
None of the others.
b.
1
c.
0
Feedback
The correct answer is: 1

Question 11
Complete
Marked out of 1.00
Flag question

Question text
/* Suppose that all needed libraries are included */int main() { int a[5]= { 1,2,3,4,5 };
int*p= a; int i; for (i=0;i<5; i++) if (i%2==0) { (*p)++; p++; } for (i=0;i<5;i++)
printf("%d, ", a[i]); getch(); return 1;}When the above program executes. What is the
output?

a.
15
b.
1, 2, 3, 4, 5
c.
2, 3, 4, 4, 5
Feedback
The correct answer is: 2, 3, 4, 4, 5

Question 12
Complete
Marked out of 1.00
Flag question

Question text
Study the function:int t (char* S) { for (int i=0; i<strlen(S); i++) S[i] = toupper(S[i]); return
1;}Code in the main function:char S[80]= “Hello”;int x=t(S);prinf(“%s%d”, S, x);What is the
output?

a.
None of the others
b.
HELLO1
c.
1Hello
d.
hello
e.
Hello
Feedback
The correct answer is: HELLO1

Question 13
Complete
Marked out of 1.00
Flag question

Question text
int d= 7, t, a;switch d{ case 7: t=a=3; case 10: t=a=1; case 5: t=a=20; break; default:
t=a=0;}AFTER THE ABOVE CODE IS EXECUTED, WHAT IS THE VALUE OF THE VARIABLE A.

a.
An error will be thrown when the code is compiled.
b.
A warning will be thrown when the code is compiled.
c.
0
d.
3
Feedback
The correct answer is: An error will be thrown when the code is compiled.

Question 14
Complete
Marked out of 1.00
Flag question

Question text
AN ARRAY WILL BE ALLOCATED .... TO STORE ITS ELEMENTS.

a.
None of the others.
b.
a contiguous memory block
c.
a contiguous memory block with the maximum size of 1024 bytes
d.
some discontiguous memory blocks
Feedback
The correct answer is: a contiguous memory block

Question 15
Complete
Marked out of 1.00
Flag question

Question text
A computer program ........

a.
will increase performance of standard workflow.
b.
All of the others.
c.
is a simulation of solution.
d.
is a set of instructions that computer hardware will execute.
Feedback
The correct answer is: All of the others.

Question 16
Complete
Marked out of 1.00
Flag question

Question text
Study the following function:int t (int x, int y, int z){ return x+y+z>20 ? 10 : 20;}If this
function is called as following with input data are 5 10 15. What is the output? int a,b,c;
printf("Enter 3 integers:"); scanf("%d%d%d", &a, &b, &c); printf("%d", t(b,c,a));

a.
10
b.
None of the others.
c.
20
d.
-10
Feedback
The correct answer is: 10

Question 17
Complete
Marked out of 1.00
Flag question

Question text
Study the function:int t( int n) { int remainder=0; do { remainder= n%2; if
(remainder !=0) return 0; n /=2; } while(n>0); return remainder ;}The statement
T(124) will return ….
a.
1
b.
None of the others.
c.
0
Feedback
The correct answer is: 0

Question 18
Complete
Marked out of 1.00
Flag question

Question text
Study the function:void t (int a, int b) { int t=a+1; a=b+1; b=t+1;}This function is called as:int
x=5, y=2;t(x,y);printf("%d,%d", x, y);What is the output?

a.
3,6
b.
6,3
c.
5,2
d.
None of the others
e.
2,5
Feedback
The correct answer is: 5,2

Question 19
Complete
Marked out of 1.00
Flag question

Question text
Array is ……..

a.
A group of different variables
b.
A group of elements which can have different data type
c.
A group of elements which have the same data type.
d.
A group of constants.
Feedback
The correct answer is: A group of elements which have the same data type.

Question 20
Complete
Marked out of 1.00
Flag question

Question text
Study the function:void t(char* S) { for (int i=0; i<strlen(S); i++) S[i] = S[i]+1;}This function is
called as:char S[10]= “ABCD”;printf(“%s”, t(S));What is the output?

a.
Abcd
b.
Compile-time error.
c.
ABCD
d.
BCDE
Feedback
The correct answer is: Compile-time error.

Question 21
Complete
Marked out of 1.00
Flag question

Question text
POINTER SUPPORTS A[NO] …. WAY TO ACCESS DATA.

a.
indirect
b.
None of the others.
c.
indirect
Feedback
The correct answer is: indirect

Question 22
Complete
Marked out of 1.00
Flag question

Question text
IF (X>10) /*1*/ Y=2;IF (X<20) /*2*/ Y=6;IF (X==0) /*3*/ Y=7;ELSE Y = -1;THE ELSE
STATEMENT WILL ASSOCIATE WITH THE STATEMENT …..

a.
1
b.
2
c.
3
d.
All of the others.
Feedback
The correct answer is: 3

Question 23
Complete
Marked out of 1.00
Flag question

Question text
In a flowchart, we use a ......... to express a decision.

a.
Oval
b.
Polygon
c.
Rectangle
d.
Diamond
Feedback
The correct answer is: Diamond

Question 24
Complete
Marked out of 1.00
Flag question

Question text
A unit data in text file is …..

a.
A string.
b.
An ASCII code of a character.
c.
A word.
d.
A number.
Feedback
The correct answer is: An ASCII code of a character.

Question 25
Complete
Marked out of 1.00
Flag question

Question text
A VARIABLE THAT IS DECLARED IN A FUNCTION IS CALLED AS …

a.
None of the others.
b.
Local variable
c.
Dynamic data
d.
Global variable
Feedback
The correct answer is: Local variable

Question 26
Complete
Marked out of 1.00
Flag question

Question text
(1) One byte consists of 4 nibbles.(2) One nibble consists of 2 consecutive bitsThe
statement (1) is ...., (2) is .....

a.
true, true
b.
false, false
c.
true, false
d.
false, true
Feedback
The correct answer is: false, false

Question 27
Complete
Marked out of 1.00
Flag question

Question text
/* Suppose that all needed libraries are included */void f(char S[ ], char c1, char c2){ int L=
strlen(S); int i; for (i=0; i<L; i++) if (*(S+i) == c1) *(S+i)=c2;}int main() { char
S[10]="ABCDEFGEH"; f( S, 'E', 0); printf("%s", S); getch(); return 1;}The output of the
program is ......

a.
ABCD
b.
ABCD0FG0H
c.
ABCDEFGEH
d.
None of the others.
Feedback
The correct answer is: ABCD

Question 28
Complete
Marked out of 1.00
Flag question

Question text
Data validations do not include ...

a.
None of the others
b.
invalid characters
c.
out-of-range input
d.
incorrect number of input fields
e.
trailing characters
Feedback
The correct answer is: None of the others

Question 29
Complete
Marked out of 1.00
Flag question

Question text
Correct order of a function implementation:
a.
Return type, parameters, body, function name
b.
Return type, function name, parameters, body
c.
Return type, body, function name, parameters
d.
Return type, body, parameters, function name
Feedback
The correct answer is: Return type, function name, parameters, body

Question 30
Complete
Marked out of 1.00
Flag question

Question text
Choose the correct statement about the else statement in C language.

a.
The rule in C is that an else always belongs to the innermost if available.
b.
The else statement is an independent statement.
c.
The rule in C is that an else always belongs to the outermost if available.
d.
None of the others.
Feedback
The correct answer is: The rule in C is that an else always belongs to the innermost if
available.

You might also like