Quiz Prf192 (Fe)
Quiz Prf192 (Fe)
Answer saved
Marked out of 1.00
Flag question
Question text
An element of an array can be identified by ...
a.
Its data type
b.
Its position in the array
c.
its value
d.
its name
Clear my choice
Question 2
Answer saved
Marked out of 1.00
Flag question
Question text
There are two ways to express an algorithm. They are ......... and ...........
a.
program, instructions
b.
pseudo code, flowchart
c.
instructions , flowchart
d.
program, flowchart
Clear my choice
Question 3
Answer saved
Marked out of 1.00
Flag question
Question text
MEMORY SIZE OF THE INT DATA TYPE:
a.
4 bytes
b.
8 bytes
c.
2 bytes
d.
depends on the compiler.
Clear my choice
Question 4
Answer saved
Marked out of 1.00
Flag question
Question text
Choose the correct statement about the else statement in C language.
a.
The else statement is an independent statement.
b.
The rule in C is that an else always belongs to the outermost if available.
c.
The rule in C is that an else always belongs to the innermost if available.
d.
None of the others.
Clear my choice
Question 5
Answer saved
Marked out of 1.00
Flag question
Question text
Suppose that the following codes execute. What is the output? long S=10; long i; for (i=1;
i<10; i++) if (i%3==0) S+=i; printf("%ld", S);
a.
16
b.
19
c.
22
d.
31
e.
None of the others.
Clear my choice
Question 6
Answer saved
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.
All of the others.
c.
3
d.
2
Clear my choice
Question 7
Answer saved
Marked out of 1.00
Flag question
Question text
/* Suppose that all needed libraries are included */int main() { int n, m; scanf("%d,
%d",&n, &m); printf("%d, %d", n, m); getch(); return 1;}When the program executes, user
enters 9 100 . What is output?
a.
9 and a non-predictable value.
b.
An error when it executes.
c.
Two non-predictable values.
d.
No output is printed out.
Clear my choice
Question 8
Answer saved
Marked out of 1.00
Flag question
Question text
THE %U CONVERSION SPECIFIER WILL BE USED FOR PRINTING ……
a.
integral number
b.
real number
c.
signed number
d.
characters
e.
strings
Clear my choice
Question 9
Answer saved
Marked out of 1.00
Flag question
Question text
Flagging is the solution of using a masking array to search the inputted valued from the
user only.
a.
True
b.
False
Clear my choice
Question 10
Answer saved
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.
None of the others.
c.
ABCD0FG0H
d.
ABCDEFGEH
Clear my choice
Question 11
Answer saved
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.
20
c.
None of the others.
d.
10
Clear my choice
Question 12
Answer saved
Marked out of 1.00
Flag question
Question text
Flags is a technique that supports using goto, continue statements
a.
False
b.
True
Clear my choice
Question 13
Answer saved
Marked out of 1.00
Flag question
Question text
a.
true, true
b.
false, false
c.
false, true
d.
true, false
Clear my choice
Question 14
Answer saved
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.
1, 2, 3, 4
c.
1, 3, 2, 4
d.
3, 1, 2, 4
Clear my choice
Question 15
Answer saved
Marked out of 1.00
Flag question
Question text
Suppose that the following code is valid. What is the output if it executes?int d=10;switch
(d){ case 10: putchar(‘A’); case 9: putchar(‘B’); case 8: putchar(‘C’); default: putchar(‘D’);}
a.
ABCD
b.
AD
c.
A
d.
None of the others
Clear my choice
Question 16
Answer saved
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.
some discontiguous memory blocks
d.
a contiguous memory block with the maximum size of 1024 bytes
Clear my choice
Question 17
Answer saved
Marked out of 1.00
Flag question
Question text
WHAT IN THE FOLLOWING FUNCTION PROTOTYPES SHOULD BE USED FOR COUNTING
NUMBERS IN A TEXT FILE CONTAINING INTEGERS?
a.
void count( char filename[], int x );
b.
long count( char filename[], int x );
c.
void count( char filename[] );
d.
long count( char filename[] );
Clear my choice
Question 18
Answer saved
Marked out of 1.00
Flag question
Question text
A unit data in text file is …..
a.
A word.
b.
A string.
c.
An ASCII code of a character.
d.
A number.
Clear my choice
Question 19
Answer saved
Marked out of 1.00
Flag question
Question text
The function scanf(…) will return ……..
a.
Value of the first data entered.
b.
Number of fields successfully entered.
c.
1 if success, 0 if failed.
d.
A list of data entered
Clear my choice
Question 20
Answer saved
Marked out of 1.00
Flag question
Question text
WHAT IN THE FOLLOWING FUNCTION PROTOTYPES SHOULD BE USED FOR COUNTING
VOWELS IN A TEXT FILE?
a.
void count( char filename[], char vowel );
b.
long count( char filename[] );
c.
void count( char filename[] );
d.
long count( char filename[], char vowel );
Clear my choice
Question 21
Answer saved
Marked out of 1.00
Flag question
Question text
What guideline should be examined before working with a text file?(1) data format in the
file must be known or designed.(2) number of values in the file must be known .(3) Last
date modified of the file must be known.
a.
2
b.
None of the others.
c.
1
d.
3
Clear my choice
Question 22
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output if the following code executes.int n=3, m=7;int* p1= &n, *p2=&m;*p1 -=
m+n- 3*(*p2);*p2 += *p1%2 ? 2 : 5; printf ("%d", m-n);
a.
-5
b.
4
c.
-4
d.
6
e.
None of the others.
Clear my choice
Question 23
Answer saved
Marked out of 1.00
Flag question
Question text
The getchar function ....
a.
treats the whitespace between the input values as a separator
b.
None of the others
c.
clears the buffer automatically after retrieving
d.
retrieves data values from every keystroke directly
Clear my choice
Question 24
Answer saved
Marked out of 1.00
Flag question
Question text
STRCAT(“HELLO”, “WORLD”) WILL ….
a.
None of the others.
b.
Helloworld
c.
cause an error.
d.
worldHello
Clear my choice
Question 25
Answer saved
Marked out of 1.00
Flag question
Question text
A computer program ........
a.
is a set of instructions that computer hardware will execute.
b.
is a simulation of solution.
c.
will increase performance of standard workflow.
d.
All of the others.
Clear my choice
Question 26
Answer saved
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.
0
b.
None of the others.
c.
1
Clear my choice
Question 27
Answer saved
Marked out of 1.00
Flag question
Question text
Study the following code:int x= 17, y=1, z=3;if (x>2*y+z) y=5; z=2;else{ y=3; z=1;}
a.
There is an error in these statements.
b.
here is a warning when the codes are compiled and after these statements are executed,
the value of variable z is 1.
c.
After these statements are executed, the value of the variable z is 2.
d.
After these statements are executed, the value of the variable z is 1.
Clear my choice
Question 28
Answer saved
Marked out of 1.00
Flag question
Question text
Study the binary search algorithm:int binarySearch (int x, int a[], int low, int high){ while
(low<=hight) { int mid= (low+high)/2; if ( x==a[mid]) return mid ; else if (x>a[mid])
low=mid+1; else high=mid-1; } return -1;} Suppose that this function is used as
following:INT A[6] = { 1, 2, 2, 3, 3,5};INT POS = BINARYSEARCH(3,A,0,5);What is the value of
the variable pos?
a.
4
b.
-1
c.
3
d.
None of the others.
Clear my choice
Question 29
Answer saved
Marked out of 1.00
Flag question
Question text
Restricting our use of the language to the standard subset of a language will create the
......... of a program.
a.
efficiency
b.
correctness
c.
reliability
d.
portability
Clear my choice
Question 30
Answer saved
Marked out of 1.00
Flag question
Question text
Correct order of a function implementation:
a.
Return type, body, parameters, function name
b.
Return type, body, function name, parameters
c.
Return type, parameters, body, function name
d.
Return type, function name, parameters, body
Question 31
Answer saved
Marked out of 1.00
Flag question
Question text
Suppose that a value of the INT type will be stored in 4 BYTES.int n=7;In C, if this variable is
written to a textfile (using ASCII code), it will take ... byte(s) in the file.
a.
4
b.
1
c.
2
d.
3
Clear my choice
Question 32
Answer saved
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.
2, 3, 4, 4, 5
c.
1, 2, 3, 4, 5
Clear my choice
Question 33
Answer saved
Marked out of 1.00
Flag question
Question text
a.
All of them have different outputs.
b.
(2) and (3) have the same output.
c.
(1) and (3) have the same output.
d.
(1) and (2) have the same output.
Clear my choice
Question 34
Answer saved
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.
BCDE
d.
Abcd
Clear my choice
Question 35
Answer saved
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 constants.
d.
A group of elements which have the same data type.
Clear my choice
Question 36
Answer saved
Marked out of 1.00
Flag question
Question text
Internal features affect on the quality of a software are …….
a.
Usability
b.
Reliability
c.
Correctness
d.
Reusability
Clear my choice
Question 37
Answer saved
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.
1Hello
c.
HELLO1
d.
hello
e.
Hello
Clear my choice
Question 38
Answer saved
Marked out of 1.00
Flag question
Question text
The type character of the int datatype is ………, and the float datatype is …….
a.
%i %L
b.
%i %f
c.
%d %ld
d.
%i %s
e.
%d %lf
Clear my choice
Question 39
Answer saved
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.
4
b.
6
c.
5
d.
2
e.
7
Clear my choice
Question 40
Answer saved
Marked out of 1.00
Flag question
Question text
/* Suppose that all needed libraries are included */int main() { int n; char c;
scanf("%d",&n); c=getchar(); printf("%d, %d", n,c); getch(); return 1;}What is the output
of the above program if user enters the keys 1 2 and ENTER?
a.
Non-predictable values.
b.
No output is printed out.
c.
12, 13
d.
12
e.
12, 10
Clear my choice
Question 41
Answer saved
Marked out of 1.00
Flag question
Question text
THE DO…WHILE LOOP CAN BE EXECUTED AT LEAST … TIME(S)
a.
3
b.
2
c.
0
d.
1
Clear my choice
Question 42
Answer saved
Marked out of 1.00
Flag question
Question text
The unit of memory within CPU is ............
a.
None of the others.
b.
2 bytes
c.
bit
d.
word
e.
byte
f.
4 bytes
Clear my choice
Question 43
Answer saved
Marked out of 1.00
Flag question
Question text
THE FUNCTION SCANF(…) WILL RETURN ……..
a.
Value of the first data entered.
b.
Only one field entered.
c.
A list of data entered.
d.
Number of fields entered.
Clear my choice
Question 44
Answer saved
Marked out of 1.00
Flag question
Question text
THE CORRECT ORDER OF A FUNCTION IMPLEMENTATION:
a.
Return type, parameters, body, function name.
b.
Return type, body, parameters, function name.
c.
Return type, body, function name , parameters.
d.
Return type, function name, parameters, body.
Clear my choice
Question 45
Answer saved
Marked out of 1.00
Flag question
Question text
....... help(s) identifying the device which will communiate with CPU.
a.
Control bus.
b.
Data bus.
c.
All of others.
d.
Address bus.
Clear my choice
Question 46
Answer saved
Marked out of 1.00
Flag question
Question text
Validation do not include
a.
trailing characters
b.
invalid characters
c.
incorrect number of input fields
d.
None of the others
e.
out-of-range input
Clear my choice
Question 47
Answer saved
Marked out of 1.00
Flag question
Question text
PROGRAM INFORMATION CONSISTS OF ....
a.
Code only.
b.
Code and data.
c.
Data only.
d.
None of the others
Clear my choice
Question 48
Answer saved
Marked out of 1.00
Flag question
Question text
Suppose the following code is valid. What is the output?int m = 256;int c=
(char)m;print(“%c”, c);
a.
128
b.
A non-predictable value.
c.
0
d.
256
Clear my choice
Question 49
Answer saved
Marked out of 1.00
Flag question
Question text
What do the scanf(“%d%*c”, &number) statement do?
a.
swallow the new line symbol after the input.
b.
swallow the buffer
c.
clear the buffer
d.
swallow one character first
Clear my choice
Question 50
Answer saved
Marked out of 1.00
Flag question
Question text
In a flowchart, we use a ......... to express a decision.
a.
Oval
b.
Diamond
c.
Polygon
d.
Rectangle
Clear my choice
Question 51
Answer saved
Marked out of 1.00
Flag question
Question text
SELECT (AN) INCORRECT STATEMENT(S).
a.
A C function will always need parameters.
b.
Parameters are data that will be tranfered to a function when it is called.
c.
All of the others
d.
The format of calling a function is: FunctionName(..)
Clear my choice
Question 52
Answer saved
Marked out of 1.00
Flag question
Question text
SELECT THE CORRECT STATEMENT.
a.
We can rename a file if it was closed.
b.
We can read data from a file even when it is closed.
c.
We can remove a file even when it is in opening state.
d.
We can not read a number from a text file.
Clear my choice
Question 53
Answer saved
Marked out of 1.00
Flag question
Question text
AN ELEMENT OF AN ARRAY CAN BE IDENTIFIED BY ...
a.
Its position in the array.
b.
its value.
c.
its data type.
d.
its name.
Clear my choice
Question 54
Answer saved
Marked out of 1.00
Flag question
Question text
After the following code segment is executed. What is the output if the input is ‘B’?char c=
getchar();switch(c){ case ‘A’ : putchar(c++); break; case ‘a’ : putchar(++c); break; default :
putchar(c+2);}
a.
None of the others.
b.
E
c.
C
d.
D
e.
B
Clear my choice
Question 55
Answer saved
Marked out of 1.00
Flag question
Question text
SELECT THE RIGHT STATEMENT. THE FUNCTION GETS(..) ALLOWS ENTERING A STRING …
a.
None of the others
b.
until the first blank character is dectected.
c.
having no blank character.
d.
having the length exceeds the memory size allocated for the string variable.
Clear my choice
Question 56
Answer saved
Marked out of 1.00
Flag question
Question text
STREAM IS ….
a.
a block of data.
b.
a serial data.
c.
a serial data that will processed bit by bit.
d.
a serial data that will be processed byte by byte.
Clear my choice
Question 57
Answer saved
Marked out of 1.00
Flag question
Question text
PARALLEL ARRAYS HELP STORING ……
a.
A list of structured data.
b.
None of the others.
c.
Some list of numbers only.
Clear my choice
Question 58
Answer saved
Marked out of 1.00
Flag question
Question text
SELECT A FEATURE THAT DO NOT AFFECT ON THE QUALITY OF A SOFTWARE.
a.
Correctness.
b.
Reusability.
c.
Usability.
d.
Reliability.
Clear my choice
Question 59
Answer saved
Marked out of 1.00
Flag question
Question text
Study the following code:void t( int* a, int n) { for (int i=n-1; i>=0; i--) if ( i%2==1)
printf(“%d,”, a[i]);}int a[1]= {2};What is the output if the statement T(A,1); executes?
a.
None of the others.
b.
2
c.
Nothing.
d.
2,
Clear my choice
Question 60
Answer saved
Marked out of 1.00
Flag question
Question text
In C, with reference to property of reusing a function, the function that will check whether
an integer is a prime or not, should be declared as ........
a.
a void function.
b.
a function that will return an integer.
c.
a function that returns a real number.
d.
a function that returns a string a characters.
e.
None of the others
Clear my choice
Question 61
Answer saved
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.
0
c.
None of the others.
Clear my choice
Question 62
Answer saved
Marked out of 1.00
Flag question
Question text
Suppose that the following codes execute and input data are 9 and 12. int m,n;
printf("Enter two integers:"); scanf("%d%d",&m, &n); if (m>10 && n<20) printf("%d",
m+n); else printf("%d", m-n);What is the output.
a.
None of the others.
b.
-3
c.
3
d.
21
Clear my choice
Question 63
Answer saved
Marked out of 1.00
Flag question
Question text
Statement 1: A program can only work if it is well-designedStatement 2: If the program
models a real world situation, the program will more than likely be more complex to
upgradeStatement 3: Design is about the relationship of parts to the whole
applicationStatement 4: The maintenance life cycle is not important in software
development
a.
Statement 1 is true
b.
None of the statements are true
c.
Both Statement 1 and 3 are true
d.
All of the statements are true
e.
Statement 2 is true
f.
Only Statement 2 true
g.
Both Statement 3 and Statement 4 are true
Clear my choice
Question 64
Answer saved
Marked out of 1.00
Flag question
Question text
What in the following functions are formatted io functions?
a.
scanf(…)
b.
getchar()
c.
putchar(…)
d.
println(…)
Clear my choice
Question 65
Answer saved
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.
0
b.
A warning will be thrown when the code is compiled.
c.
3
d.
An error will be thrown when the code is compiled.
Clear my choice
Question 66
Answer saved
Marked out of 1.00
Flag question
Question text
THE SCANF() FUNCTION WILL RETRIEVE DATA FROM ….
a.
The keyboard
b.
An input device
c.
The input buffer
Clear my choice
Question 67
Answer saved
Marked out of 1.00
Flag question
Question text
THE EXPRESSION THAT WILL BE EVALUATED IN THE SWITCH STATEMENT CAN BE A….
a.
string of characters.
b.
None of the others.
c.
group of integers.
d.
real number.
Clear my choice
Question 68
Answer saved
Marked out of 1.00
Flag question
Question text
Select correct statement(s)
a.
C-compilers compile all comments
b.
All of the others.
c.
C-compilers treat comments as strings of characters
d.
Comments in a program enhance the program readability
Clear my choice
Question 69
Answer saved
Marked out of 1.00
Flag question
Question text
What is the output of the following program?/* Suppose that all needed libraries are
included */int main() { double x= 3.5, y= 6.8 , z= 1.5; int n= floor( x )+ ceil( y )+ z;
printf("%d", n); getch(); return 1;}
a.
11
b.
11.5
c.
12
d.
10
e.
The program causes an error when it is compiled.
Clear my choice
Question 70
Answer saved
Marked out of 1.00
Flag question
Question text
Choose incorrect statement(s)
a.
in C, comment lines are blocked by /* and */
b.
A C statement is terminated by a colon.
c.
A C function is wrapped by curly braces.
d.
A C program will start at main() function
Clear my choice
Question 71
Answer saved
Marked out of 1.00
Flag question
Question text
/* Suppose that all needed libraries are included */int main() { char S[50]= "ABCDEF";
printf("Length:%d, %s", strlen(S), &S[2]); getch(); return 1;}The output of the program
s .......
a.
Length:6, CDEF
b.
The program causes an error when it is compiled.
c.
6, CDEF
d.
6 and an error is thrown.
Clear my choice
Question 72
Answer saved
Marked out of 1.00
Flag question
Question text
SELECT A NAME OF A METHOD FOR TESTING SOFTWARES.
a.
Statement by statement testing.
b.
Black box testing.
c.
Security testing.
d.
None of the others
e.
Correctness testing.
Clear my choice
Question 73
Answer saved
Marked out of 1.00
Flag question
Question text
Select an incorrect data definition in C language.
a.
char S2[20] = 'Hello' ;
b.
char* S4 ;
c.
char S3[40] = "Hi All!" ;
Clear my choice
Question 74
Answer saved
Marked out of 1.00
Flag question
Question text
STRCMP(“HELLO”, “HELLO1”) WILL RETURN ….
a.
1
b.
0
c.
3
d.
a negative integer.
e.
2
Clear my choice
Question 75
Answer saved
Marked out of 1.00
Flag question
Question text
A good source program is that:
a.
Other programmers try him/herself to understand it with significant effort
b.
A program is written with mix styles
c.
The coding style is consistent and clear throughout
d.
Difficult to read
Clear my choice
Question 76
Answer saved
Marked out of 1.00
Flag question
Question text
Analysis and maintenance are ............. phases in the sofware development process.
a.
first and last
b.
None of the others.
c.
last and first
d.
intermediate
Clear my choice
Question 77
Answer saved
Marked out of 1.00
Flag question
Question text
External feature affect on the quality of a software does not include…….
a.
Usability
b.
Reusability
c.
Reliability
d.
Correctness
Clear my choice
Question 78
Answer saved
Marked out of 1.00
Flag question
Question text
Select correct statement(s).Suppose that a value of the INT type will be stored in 4 BYTES.(1)
Writing int values into text file will make the file having small size.(2) Writing int values into
text file will make the file having large size.(3) Writing int values into text file is less efficient
because type conversions are needed.
a.
(3)
b.
None of the others.
c.
(2) and (3)
d.
(1) and (3)
Clear my choice
Question 79
Answer saved
Marked out of 1.00
Flag question
Question text
The function double pow(double, double) is declared in the header file .......
a.
math.h
b.
stdio.h
c.
stdlib.h
d.
conio.h
Clear my choice
Question 80
Answer saved
Marked out of 1.00
Flag question
Question text
PARAMETERS OF A FUNCTION CAN NOT BE …..
a.
two-dimensional arrays
b.
pointers
c.
None of the others
d.
one-dimensional arrays
Clear my choice