Given the code segment

1.4 Given the code segment:
char a[] = “abc”, *p;
Which of the following assigns the starting address of the string “abc” to p?
A) p = a;
B) p = &a;
C) p = *a;
D) *p = a;

What will be the output of the following code segment, if the function is called as larger(10, 20)

1.3 What will be the output of the following code segment, if the function is called as
larger(10, 20) ?
int larger(int x, int y) {
int max = x;
if (max < y) {
max = y;
return y;
}
else
return x;
printf(“Larger of %d and %d is %d”, x, y, max);
}
A) Program will not compile as the function has two return statements.
B) Program will not compile as no statement is allowed after return statement.
C) Larger of 10 and 20 is 20.
D) No output.

Which of the following switch statement is not a valid statement to print “RED” if a character variable ‘color’ has the value ‘R’ or ‘r’

1.2 Which of the following switch statement is not a valid statement to print “RED” if a character
variable ‘color’ has the value ‘R’ or ‘r’?
A) switch (color) { case ‘R’: case ‘r’: printf(“RED”); break; }
B) switch (color) { case ‘R’: printf(“RED”); break;
case ‘r’ : printf(“RED”); break; }
C) switch (toupper(color)) { case ‘R’: printf(“RED”); break; }
D) switch (color) { case ‘R’ || ‘r’ : printf(“RED”); break; }

Define a suitable data structure to store the information like student name, roll number, enrolment centre and marks of five different subjects

8. Define a suitable data structure to store the information like student name, roll number, enrolment centre and marks of five different subjects. Write a ‘C’ function to insert sufficient data in your data structure and function to print the name of the student and the total obtained marks who have secured highest total marks for each and every
enrolment centre