WorksheetsMẫu không có tiêu đề
Total questions: 114
Worksheet time: 57mins
Name
Class
Date
1.
Given the below code?
char ch;
scanf("%c",&ch);
printf("%c",ch);
A user enters "abcd" from the console
What is printed?
a)
A. Blank(nothing output)
b)
B. Compile error
c)
C. a
d)
D. abcd
2.
Which is the INCORRECT statement?
a)
A. In the buffered type, the program can respond to each and every keystroke directly.
b)
B. Input to a program maybe unbuffered or buffered.
c)
C. Buffered input enables data editing before submission to a program.
d)
D. A buffer is a region of memory that collects and holds data temporarily.
3.
Given the below code:
int a=1;
int i=7;
if(a||i++)
i++;
printf("%d", i);
What is the output
a)
A. 7
b)
B. 8
c)
C. 9
d)
D. other
4.
What does the function foef(FILE*fp) return if our program has not attempted to read the end of file mark?
a)
A. Does not return anything
b)
B. 1
c)
C. 0
d)
D. -1
5.
Which of the following are NOT TRUE about function?
a)
A. A function may receive data and may return a value.
b)
B. A function definition consists of a header and a body
c)
C. A function can receive more than one parameter
d)
D. Variable cannot passed to thee functions.
6.
What is the output when the sample code below is executed?
void fun1(int a,int b) {
a++;
b++;
}
main() {
int x=5,y=10;
fun1(x,y);
printf("%d %d",x,y);
return 0;
}
a)
A. 11 6
b)
B. 10 5
c)
C. 5 10
d)
D. 6 11
7.
Why hexadecimal and octal representations are used for sets of bits?
a)
A. Because these representations are considerably shorter and more convenient.
b)
B. Because they are larger than bit unit.
c)
C. Because modern computers process and store information in hexadecimal and octal digits.
8.
What will be the output of the following program?
#include
#include
#include
void main()
{
char str[]="xyzt";
int len=strlen(str);
for(int i=0;i
a)
A. XyZt
b)
B. xyzt
c)
C. xYzT
9.
Which is NOT a valid data type in C language?
a)
A. int
b)
B. float
c)
C. string
d)
D. double
10.
Which of the following statements is wrong?
a)
A. asd='A'*24;
b)
B. a1=1343.44;
c)
C. 3=d;
d)
D. cat='A'*'B';
11.
Which of the following functions can be used to enter an integer in C program?
a)
A. getchar
b)
B. gets
c)
C. scanf
d)
D. None of the others
12.
The following code is an infinite loop?
int number=1;
while(1){
printf("%d",number);
if(number==3)break;
number+=2;
}
a)
A. False
b)
B. True
13.
Given x, y, z are of floating-point type, which of the following C expressions is INCORRECT?
a)
A. All of the others
b)
B. x=y.z
c)
C. x=y->z
d)
D. x=y^z
14.
Decimal number 44 is...in hexadecimal
a)
A. 0x1C
b)
B. 0x1B
c)
C. 0x2B
d)
D. 0x2C
15.
What will this program print?
#include
#include
int main(void)
{
char str[]="abcd";
int len=strlen(str);
for(int i=0;i
a)
A. bcde
b)
B. edcb
c)
C. acbd
d)
D. abcd
16.
What is the output when the sample code below is executed?
int a=13,b=20;
if(a==15||b>30)
printf("Hello");
else
printf("Sorry");
a)
A. Sorry
b)
B. compiler error
c)
C. Hello
d)
D. Nothing
17.
What will be the output of the following program?
#include
int main()
{
int x[4]={2,1,4,8};
int rs=0;
for(int i=0; i<4; i++)
{
rs+=x[i];
}
printf("%d", rs);
return 0;
}
a)
A. 14
b)
B. 15
c)
C. 16
d)
D. 17
18.
The expression a[1] designates the first element in an array a.
a)
A. TRUE
b)
B. FALES
19.
What is the final value of x when the sample code below is excuted?
int x=0;
for(int i=1;i<5;i++)
for(int j=0;j<5;j++)
x++;
a)
A. 15
b)
B. 5
c)
C. 20
d)
D. 10
20.
The expression a[1] designates the first element in an array a.
a)
A. TRUE
b)
B. FALSE
21.
Which of the following statements are true with regards to the || operator?
a)
A. This operator is used to combine two logical expressions which evaluate to true if both individual expressions are true.
b)
B. If one of the conditional expressions return false, the outcome is false
c)
C. If is a relational operator
d)
D. Only if both the expressions evaluate to false, the outcome is false
22.
Suppose age is an integer variable. Select correct statements which declare a pointer of type integer and assign an address of the variable age to it.
a)
A. int*p; p=&age;
b)
B. int*; p=&age;
c)
C. *int p; p=&age;
d)
D. int*p; p=age;
23.
If is a string variable, which of the following can be used to read the whole string "Hello World"?
a)
A. gets(s);
b)
B. scanf("%[^]", s);
c)
C. scanf("%s", s);
d)
D. scanf("%s", &s);
24.
Given the program:
#include
#include
#include
int main(){
char str[50];
strcpy(str,"KLM");
for(int i=0;i
a)
A. JKL
b)
B. LMN
c)
C. KLM
d)
D. Compile error
25.
#include
#include
int main(){
int i, n, a=10, b=20;
for(i=0;i<10;i++){
n=a+rand()%(b+1-a);
printf("%d\n", n);
}
return 0;
}
Choose one right statement about the output of the above program?
a)
A. The following program prints 10 pseudo-random integers between 10 and 20 inclusively.
b)
B. The following program prints 10 pseudo-random integers between 11 and 19 inclusively.
c)
C. The following program prints 10 pseudo-random integers between 9 and 21 inclusively.
26.
What is the output of the following code?
void test(float x)
{ x+=25;
printf("Value inside the function: %.2f\n",x);
x+=25;
}
int main()
{ float y;
y=100;
printf("y=%.2f\n",y);
test(y);
printf("y=%.2f\n",y);
return(0);
}
a)
A. y=100.00 Value inside the function: 125.00 y=100.00
b)
B. y=100.00 Value inside the function: 125.00 y=150.00
27.
Why the following code is wrong?
1. int main(){
2. int a; float b, c;
3. Printf("Hello FPT University!");
4. a=0;
5. b=c=0;
6. return 0;
7. }
a)
A. Wrong at line 2: Can not write two code statements in one line.
b)
B. Wrong at line 3: C is case sensitive languege. So printf is different from Printf which is not the C keyword.
c)
C. Wrong at line 5: you can not write two assignments at the same time
28.
Evaluate the following as true or false: !(1&&0||!1)
a)
A. TRUE
b)
B. FALSE
c)
C. Invalid expression
29.
What is the output of the following code:
int choice=6:
switch(choice){
case 2:
printf("Case 2");
case 4:
printf("Case 4");
case 6:
printf("Case 6");
case 7:
printf("Case 7");
case 9:
printf("Case 9");
default:
printf("The other cases!");
}
a)
A. Case 6 Case 7 Case 9 The other cases
b)
B. Case 6
c)
C. The other cases
30.
What is required to avoid falling through from one case to the next in the switch construct?
a)
A. end;
b)
B. break;
c)
C. ;
d)
D. stop;
31.
What does the gets() function do?
a)
A. This function fetches a single character from the standard input file
b)
B. This function fetches an argument from the standard input file
c)
C. This function fetches a string from the standard input stdin (keyboard) and places it into a string which the programmer must provide.
32.
What is the output when the sample code below is executed?
int a=5, b=2;
switch(a+b){
case 1: break;
case 2: b=a; break;
default: b=-1; a=4;
}
printf("%d %d\n", a, b);
a)
A. 4 -1
b)
B. 5 5
c)
C. 5 -1
d)
D. 5 2
33.
What is the output when thw sample code below is executed?
int a[]={5,10,15,20,25};
int*p=a;
printf("%d",*p);
p++;
printf("%d",*p);
p++;
printf("%d",*p);
a)
A. 5 10 11
b)
B. 10 15 20
c)
C. 5 10 15
d)
D. 5 6 10
e)
E. 10 16 20
34.
What is the output of the following code?
void func1(int(a*)[10]){
printf("Good, It works");
}
void func2(int a[][10]){
printf("What will happen?");
}
int main(){
int a[10][10];
func1(a);
func2(a);
return 0;
}
a)
A. Good, It works
b)
B. What will happen?
c)
C. Good, It worksWhat will happen?
d)
D. None of the other choices
35.
Location of an array is the:
a)
A. Location of its last element
b)
B. Location of its second element
c)
C. Location of its first element
d)
D. None of the others
36.
What is the output when the sample code below is executed?
char mess[]="more";
char*ptr;
ptr=mess+strlen(mess);
while(ptr>mess) printf("%s",--ptr);
a)
A. more
b)
B. eoremore
c)
C. ereoremore
d)
D. oremore
e)
E. reoremore
37.
What is the output when the sample code below is executed?
int x=2, n=5, p=1;
while(n!=0){
if(n%2==1) p=p*x;
n=n/2;
x=x*x;
}
printf("%d\n",p);
a)
A. 30
b)
B. 24
c)
C. 26
d)
D. 32
e)
E. 28
38.
What is the index number of the last element of an array with 31 elements?
a)
A. Programmer-defined
b)
B. 31
c)
C. 0
d)
D. 30
39.
A data type defines how the values are stored and how the operations on those values are performed.
a)
A. False
b)
B. True
40.
What is the output when the sample code below is executed?
char a[20]="Hello,";
char *b="Word";
strcpy(a,"hello");
strcpy(a,b);
printf("%s\n", a);
a)
A. Hello, hello World
b)
B. Hello, World
c)
C. World
d)
D. hello World
41.
Why the following code is wrong?
int choice=0, a=0, b=1, c=2;
switch(choice){
case a:
printf("case A happens!");
break;
case b:
printf("Wow, that is B!");
break;
case c:
printf("C please!");
break;
}
a)
A. Lack of default at the end of switch block
b)
B. Can not assign value of choice, a, b, and c at the declaration time
c)
C. The value after the "case" keyword must be the constant
d)
D. The above code is correct
42.
What will the below sample code produce when executed?
#include
int i;
void increment(int i)
{
i++;
}
int main()
{
for(i=0; i<10; increment(i));
printf("i=%d\n", i);
return 0;
}
a)
A. It wil loop indefinitely.
b)
B. It will print out i=10.
c)
C. It will print out i=11.
d)
D. It will not compile.
43.
What is the proper declaration for the variable c in the code below?
c=getchar();
a)
A. char *c;
b)
B. char c;
c)
C. float c;
d)
D. char c[];
44.
Which of the followings are NOT a valid C identifilers?
a)
A. auto
b)
B. bigNumber
c)
C. g442277
d)
D. _ident
45.
Consider the following code:
if(a==b)
printf("\n The Numbers are equal");
else if(a
a)
A. else
b)
B. if
c)
C. else if
46.
What will be the output of this program?
#include
void main(){
printf("%c","12345"[1]);
}
a)
B. 2
b)
A. Compile error
c)
C. 4
d)
D. 5
e)
E. 3
47.
What is the output when the sample code below is executed?
int a=2;
printf("%d",++a,a+5);
a)
A. undefined
b)
B. error
c)
C. 3
d)
D. 2
48.
What is the output when the sample code below is executed?
int i=1;
while(i<=10)
if(i%2==1)
printf("%d", i++);
else
printf("%d", i--);
a)
A. compile error
b)
B. 1
c)
C. 1 2 1 2 ...(infinite loop)
d)
D. 1 2 4 6 8 10
e)
E. 1 3 5 7 9
49.
Which is the correct order when listing the following languages from the lowest to the highest level?
a)
A. C.Assembly.C++.MATLAB
b)
B. Assembly.C.C++.MATLAB
c)
C. Assembly.MATLAB.C.C++
d)
D. C.C++.Assembly.MATLAB
50.
What is the maximum value of an unsigned char?
a)
A. 128
b)
B. 127
c)
C. 255
d)
D. 256
51.
If an array has n elements, the largest subscript is _____.
a)
A. n-2
b)
B. n-1
c)
C. n
d)
D. n+1
52.
What is the correct definition of array?
a)
A. An array is the collection of different data types located next to each other in the memory
b)
B. An array is a collection of the same data type spread throughout the memory
c)
C. An array is the collection of the same data type located next to each other in the memory
d)
D. An array is a collection of different data types spread throughout the memory
53.
What is the output wwhen the sample code below is executed?
void foo(int x, int *y){
x=x*x;
y=y**y;
}
int main(){
int x=-5, y=-2;
foo(x,y);
printf("%d %d", x, y);
return 0;
}
a)
A. -5 4
b)
B. -5 -4
c)
C. -5 -2
d)
D. 25 4
e)
C. 5 4
54.
Given the declaration:
int ref[]={1,2,4};
What is the value of *(ref+1)?
a)
A. 1
b)
B. 2
c)
C. 4
d)
D. None of the above
55.
Given the program:
#include
#include
void main(){
char str[50];
strcpy(str,"Hello world");
*(str+7)='\0';
printf("%s", str);
}
What is printed?
a)
C. Hello w
b)
A. Error
c)
B. Hello world
d)
D. Other
e)
E. Hello \0rld
56.
Which of the following statements are true with regards to the || operator?
a)
A. If one of the conditional expressions return false, the outcome is false
b)
B. This operator is used to combine two logical expressions which evaluate to true if both individual expressions are true.
c)
C. Only if both the expressions evaluate to false, the outcome is false
d)
D. It is a relational operator
57.
What is the output of the following code?
int sum(int n);
int main();
{
printf("s=%d\n", sum(5));
return(0);
}
int sum(int n)
{
int s, i;
s=0;
for(i=1;i<=n;i++);
return(s);
}
a)
A. 13
b)
B. 14
c)
C. 16
d)
D. 15
58.
What is value of a when the following code is executed?
int a=10;
int *pa=a;
(*pa)++;
a=a+10;
a)
A. 10
b)
B. 11
c)
C. 21
d)
D. 20
59.
What is the output when the sample code below is executed?
int i=0;
for(;i;)
printf("This is a loop");
if(i>0)
printf("in C program");
a)
A. This is a loop in C program
b)
B. Nothing (no output)
c)
C. Garbage value
d)
D. in C program
e)
E. This is a loop
60.
What is the output when the sample code below is executed?
int count=10, *temp, sum=0;
temp=count;
*temp=20;
temp=sum;
*temp=count;
printf("%d %d %d", count, *temp, sum);
a)
A. 20 20 20
b)
B. 10 10 10
c)
C. 10 20 10
d)
D. 20 20 10
61.
What is the output when the sample code below is executed:
main()
{
int i=5;
printf("%d", i=++i==6);
}
a)
A. 5
b)
B. 0
c)
C. 7
d)
D. 1
e)
E. 6
62.
Which library that the following functions belong to?
double round (double);
double ceil (double);
double sqrt (double);
double pow (double base, double exponent);
a)
A. stdio.h
b)
B. math.h
c)
C. time.h
d)
D. stdlib.h
63.
What is the final value of x when the sample code below is executed?
int x=0;
for(int i=1;i<5;i++)
for(int j=0;j<5;j++)
x++;
a)
A. 15
b)
B. 5
c)
C. 10
d)
D. 20
64.
What will be the output of the following program?
#include
int main()
{
int x[4]={2, 1, 4, 8};
int rs=0;
for(int i=0; i<4;i++)
{
rs+=x[i];
}
printf("%d", rs);
return 0;
}
a)
A. 14
b)
B. 15
c)
C. 16
d)
D. 17
65.
char name[31];
scanf("%[a-zA-Z0-9]", name);
Which is the correct statement about the above code?
a)
A. Accepts only lower case letters (in the range between 'a' and 'z') upper case letters (int the range between 'A' and 'Z') andd digits (in the range '0' to '9')
b)
B. Accepts any charaters excepts lower case letters (in the range between 'a' and 'z') upper case letters (in the range between 'A' and 'Z') and digits (in the range '0' and '9')
c)
C. Accepts only spaces, lower case letters (in the range between 'a' and 'z') upper case letters (in the range between 'A' and 'Z') and digits (in the range '0' to '9')
66.
What is the output of this program?
#include
int main(void)
{
char note[]="Meet me at 7pm";
char *ptr;
ptr=note;
note[7]='\0';
puts(++ptr);
return 0;
}
a)
A. eet me a
b)
B. Meet me
c)
C. Meet m
d)
D. eet me
67.
Which is the proper declaration of a string named str which stores the value "Melodies"
a)
A. char str[]=Melodies;
b)
B. char str[7]="Melodies";
c)
C. char str[9]='Melodies';
d)
D. char str[]="Melodies";
68.
What will be the output of the following program?
#include
#include
#include
void main()
{
char str[]="abcd";
int len=strlen(str);
for(int i=0;i
a)
A. aBcD
b)
B. abcd
c)
C. ABCD
d)
D. AbCd
69.
The operation between float and int would give the result as
a)
A. float
b)
B. int
c)
C. insigned int
d)
D. double
e)
E. none of the other choices
70.
Which one of the followings is the parameter passed to getchar()?
a)
A. It takes no parameters.
b)
B. Characters to be displayed.
c)
C. String variable.
d)
D. None of the other choices
71.
Why the following code is wrong?
1. int main(){
2. int a; float b, c;
3. Printf("Hello FPT University!");
4. a=0;
5. b=c=0;
6. return 0;
7. }
a)
A. Wrong at line 2: Can not write two code statements in one line.
b)
B. Wrong at line 5: you can not write two assignments at the same time
c)
C. Wrong at line 3: C is case sensitive language. So printf is different from Printf which is not C keyword.
72.
Which of the following statements is INCORRECT?
a)
A. If a file opened for writing already exits, its content will be overwritten
b)
B. If a file is opened for reading, it is required that the file must exist
c)
C. None of the others
d)
D. If a file is opened for writing, it is required that the file must exist
73.
Which one of the following printf() format specifers indicates to print a double value in decimal notation, left aligned in a 30-character field, to four(4) digits of precision?
a)
A. %-4.30f
b)
B. %-30.4f
c)
C. %#30.4f
d)
D. %4.30e
e)
E. %-30.4e
74.
What is the output when the sample ccode below is executed?
char mess[]="You are welcome here";
char *p;
p=mess;
mess[8]='\0';
puts(++p);
a)
A. our are
b)
B. our are wel
c)
C. Your are we
d)
D. Your are
75.
Which of the following functions can be used to enter an integer in C program?
a)
A. getchar
b)
B. get
c)
C. scanf
d)
D. None of the others
76.
What will be printed when the sample code below is executed?
int x=0;
for(;;){
if(x++==4)
break;
continue;
}
printf("%d\n", x);
a)
A. 5
b)
B. 6
c)
C. 4
d)
D. 1
e)
E. 0
77.
In a C program, we cannot write more than one function.
a)
A. False
b)
B. True
78.
Which of the following is a complete function?
a)
A. void funct(x) {printf("Hello");}
b)
B. int funct(int x) {return x=x+1;}
c)
C. void funct(int) {printf("Hello");}
d)
D. int funct();
79.
What is the equivalence of 0125 (base 8) in Hex (base 16)?
a)
A. 75
b)
B. 55
c)
C. 65
d)
D. 45
80.
What is the value of x after executing the code:
int x;
for(x=0;x<10;x++){}
a)
A. 10
b)
B. 1
c)
C. 9
d)
D. 0
81.
Decimal number 44 is ... in hexadecimal
a)
A. 0x1C
b)
B. 0x2B
c)
C. 0x1B
d)
D. 0x2C
82.
Given the code below:
int a=2;
printf("%d", ++a, a+5);
What is printed?
a)
A. 3
b)
B. error
c)
C. 2
d)
D. undefined
83.
Which one is NOT correct?
a)
A. 1MB=2^20 Bytes
b)
B. 1GB=1024 MB
c)
C. 1MB=1024 Bytes
d)
D. 1KB=2^10Bytes
84.
What is the output of the below code
printf("%x", 254);
a)
A. fe
b)
B. ef
c)
C. fd
d)
D. 254
e)
E. Error because %x is invalid
85.
What is the output of the following code?
main(){
int x=5;
for(;x==0;x--){
printf("x=%d\n", x--);
}
}
a)
A. 1, 2, 3, 4, 5
b)
B. 4, 3, 2, 1, 0
c)
C. 0, 1, 2, 3, 4
d)
D. None of the other choices
86.
Which is NOT a valid function for reading from a file?
a)
A. fgetchar()
b)
B. fscanf()
c)
C. fgetc()
d)
D. fgets()
87.
How many time the statement is executed?
for(int i=1; i<=5; i++)
for(int j=1; j<=10; j++)
statement;
a)
A. 50
b)
B. 15
c)
C. 5
d)
D. 10
88.
Function strlen() is for finding the number of characters a string
a)
A. True
b)
B. False
89.
Which function is not used to read from a file?
a)
A. fgetc
b)
B. fscanf
c)
C. fprintf
d)
D. fgets
90.
Assume that the size of int data type iss 4 bytes.
What is the output when the sample code below is executed?
int a[5]={0}, x=2111223;
while (x>10){
a[x%10-1]++;
x/=10;
}
printf("%d", a[1]);
a)
A. 2
b)
B. 1
c)
C. 6
d)
D. 3
91.
Given x, y, z are of floating-point type which of the following C expressions is INCORRECT?
a)
A. x=y.z
b)
B. All of the others
c)
C. x=y^z
d)
D. x=y->z
92.
Which value can not be assigned to an unsigned-short type?
a)
A. 1000
b)
B. -3
c)
C. 1
d)
D. 0
e)
E. 59876
93.
What does the gets() function do?
a)
A. This function fetches a single charater from the standard input file
b)
B. This is function fetches a string from the standard inpput stdin (keyboard) and places it into a string which the prgrammer must provide.
c)
C. This function fecthes an argument from the standard input file
94.
What is the correct statements for input data?
a)
A. scanf("%d", age);
b)
B. Scanf("%d", age);
c)
C. scanf(age):
d)
D. scanf("%d", age);
95.
What is the output when the sample code below is executed?
int x=1000;
while(x++<1003)
printf("%d", x);
printf("%d\n", x);
a)
A. 1000 1001 1002 1003
b)
B. 1000 1001 1002
c)
C. 1001 1002 1003 1004
d)
D. 1001 1002 1003
96.
What is the output when the sample code below is executed?
void foo(int *z){
return(m+2);
}
int main(){
int a=45, *b, m=10;
b=foo(a);
printf("\n%d %b", a , b);
return 0;
}
a)
A. 45 12
b)
B. 45 10
c)
C. compile erroer
d)
D. 10 45
e)
E. 12 12
97.
Why the following code is wrong?
1. int main(){
2. int a; float b, c;
3. Printf("Hello FPT University!");
4. a=0;
5. b=c=0;
6. return 0;
7. }
a)
A. Wrong at line 2: Can not write two code statements in one line.
b)
B. Wrong at line 3: C is case sensitive languege. So printf is different from Printf which is not the C keyword.
c)
C. Wrong at line 5: you can not write two assignments at the same time
98.
Evaluate the following as true or false: !(1&&0||!1)
a)
A. TRUE
b)
B. FALSE
c)
C. Invalid expression
99.
What is required to avoid falling through from one case to the next in the switch construct?
a)
A. end;
b)
B. break;
c)
C. ;
d)
D. stop;
100.
What does the gets() function do?
a)
A. This function fetches a single character from the standard input file
b)
B. This function fetches an argument from the standard input file
c)
C. This function fetches a string from the standard input stdin (keyboard) and places it into a string which the programmer must provide.
101.
Location of an array is the:
a)
A. Location of its last element
b)
B. Location of its second element
c)
C. Location of its first element
d)
D. None of the others
102.
What is the index number of the last element of an array with 31 elements?
a)
A. Programmer-defined
b)
B. 31
c)
C. 0
d)
D. 30
103.
A data type defines how the values are stored and how the operations on those values are performed.
a)
A. False
b)
B. True
104.
Why the following code is wrong?
int choice=0, a=0, b=1, c=2;
switch(choice){
case a:
printf("case A happens!");
break;
case b:
printf("Wow, that is B!");
break;
case c:
printf("C please!");
break;
}
a)
A. Lack of default at the end of switch block
b)
B. Can not assign value of choice, a, b, and c at the declaration time
c)
C. The value after the "case" keyword must be the constant
d)
D. The above code is correct
105.
What will the below sample code produce when executed?
#include
int i;
void increment(int i)
{
i++;
}
int main()
{
for(i=0; i<10; increment(i));
printf("i=%d\n", i);
return 0;
}
a)
A. It wil loop indefinitely.
b)
B. It will print out i=10.
c)
C. It will print out i=11.
d)
D. It will not compile.
106.
What is the proper declaration for the variable c in the code below?
c=getchar();
a)
A. char *c;
b)
B. char c;
c)
C. float c;
d)
D. char c[];
107.
Consider the following code:
if(a==b)
printf("\n The Numbers are equal");
else if(a
a)
A. else
b)
B. if
c)
C. else if
108.
What will be the output of this program?
#include
void main(){
printf("%c","12345"[1]);
}
a)
B. 2
b)
A. Compile error
c)
C. 4
d)
D. 5
e)
E. 3
109.
Which is the correct order when listing the following languages from the lowest to the highest level?
a)
A. C.Assembly.C++.MATLAB
b)
B. Assembly.C.C++.MATLAB
c)
C. Assembly.MATLAB.C.C++
d)
D. C.C++.Assembly.MATLAB
110.
What is the maximum value of an unsigned char?
a)
A. 128
b)
B. 127
c)
C. 255
d)
D. 256
111.
If an array has n elements, the largest subscript is _____.
a)
A. n-2
b)
B. n-1
c)
C. n
d)
D. n+1
112.
What is the correct definition of array?
a)
A. An array is the collection of different data types located next to each other in the memory
b)
B. An array is a collection of the same data type spread throughout the memory
c)
C. An array is the collection of the same data type located next to each other in the memory
d)
D. An array is a collection of different data types spread throughout the memory
113.
Given the declaration:
int ref[]={1,2,4};
What is the value of *(ref+1)?
a)
A. 1
b)
B. 2
c)
C. 4
d)
D. None of the above
114.
What does the following declaration mean (If there are more than one correct answers, choose the best one)
int*ptr[10];v
a)
A. Array of 10 pointers
b)
B. Pointers to the array of 10 elements
c)
C. Array of 10 integer pointers
100 %
Similar Resources on Wayground
113 questions
SOAL UJIAN TEORI BASIC AVSEC ITSM
Worksheet
•
University
110 questions
Review_CS_Final Exam
Worksheet
•
9th - 12th Grade
111 questions
Physics Final 2025
Worksheet
•
KG - University
110 questions
8th Grade Quarter 3 Study Guide
Worksheet
•
8th Grade
110 questions
Hallum Review Art 2 Semester 1 Final
Worksheet
•
KG - University
109 questions
№8 Қозғалыс. Сүйек, буын, бұлшықет құрылысы
Worksheet
•
KG - University
109 questions
Biology 2: Semester 1 Final Exam REVIEW (Introduction-Animals)
Worksheet
•
KG - University
