Professional Documents
Culture Documents
http://www.cquestions.com/2012/02/data-type-questions-in-c.html
http://www.indiabix.com/c-programming/pointers/
Directions
Step 1: Identify solution without any assistance (compiler, textbook, Google, etc).
Step 2: Research (textbook, Google), work (compiler), and implement the solution.
Resolve the difference by collaborating and corroborating with your classmates. If still not resolved, check with me.
Due to compilers using different standards and some not conforming to standards, it is possible for the output to be different or
incorrect. So its important that you identify the correct version and use that as reference for the exam preparation.
Some questions might refer to topics we have not covered yet for the current exam. Save it for the future exam.
If the code generates a compilation error, then identify the reason for the error and fix it.
Questions Lesson(s) Learned
1 What will be the output of the program if the array begins 4300 in memory? https://www.indiabix.com/c-
#include<stdio.h> programming/arrays/044001
void main(void) 3 garbage values
2 Which of the following statements are correct about 3 used in the program? B
int num[3];
num[3]=6;
A. In the first statement 3 specifies a particular element, whereas in the
second statement it specifies a type.
B. In the first statement 3 specifies an array size, whereas in the second
statement it specifies a particular element of array.
C. In the first statement 3 specifies a particular element, whereas in the
second statement it specifies an array size.
D. In both the statement 3 specifies array size.
3 Which of the following statements are correct about an array? 1. The array int num[26]; can store 26
1: The array int num[5]; can store 5 elements. elements. This statement is true.
2: The expression num[1] designates the very first element in the array.
3: It is necessary to initialize the array at the time of declaration. 2. The expression num[1] designates the
4: The declaration num[SIZE] is allowed if SIZE is a macro. very first element in the array. This
statement is false, because it designates
the second element of the array.
#include<stdio.h>
void main(void){
char data[2][3][2]={0,1,2,3,4,5,6,7,8,9,10,11};
printf("%d",data[0][2][1]);
}
Intentionally left blank.