Question
QUESTION 14 What will be the output of following statements? int my_array[5] = { [2] = 1, [4] = 3 }; for (int i =
QUESTION 14
-
What will be the output of following statements?
int my_array[5] = { [2] = 1, [4] = 3 };
for (int i = 0; i<5; i++)
printf("%d ", my_array[i]);
A. 0 0 0 1 0 3
B. 0 0 1 0 3 0
C. 0 0 0 1 3
D. 0 0 1 0 3
3 points
QUESTION 15
-
What will be the output of following statements?
int a[5] = {1, 2, 3, 4, 5};
int i, j, k;
i = ++a[1];
j = a[1]++;
k = a[i++];
printf("%d, %d, %d", i, j, k);
A. 4, 4, 4
B. 3, 4, 5
C. 4, 3, 4
D. 4, 4, 5
-
QUESTION 17
-
What will be the output of following code?
#include
void func( ) ;
void main( )
{
func( ) ;
func( ) ;
}
void func( )
{
auto int i = 10 ;
register int j = 10 ;
static int k = 10 ;
--i ; --j ; --k ;
printf ( " %d % d %d", i, j, k ) ;
}
A. 9 9 9
9 8 8
B. 9 9 9
8 8 8
C. 9 9 9
9 9 9
D. 9 9 9
9 9 8
-
QUESTION 19
-
What gets printed after execution of following statements?
int i = 4;
if(i%2)
printf("Snow Day!!!");
else
printf("Exam Time!!!");
A. Exam Time!!!
B. Snow Day!!!
C. Run-time Error
D. Compile-time Error
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started