July 7, 2021 in C and CPP
The sqrt() function is available in
1.7 The sqrt() function is available in
A) conio.h
B) string.h
C) math.h
D) graphic.h
July 7, 2021 in C and CPP
1.7 The sqrt() function is available in
A) conio.h
B) string.h
C) math.h
D) graphic.h
July 7, 2021 in C and CPP
1.6 Function putchar() displays
A) one word at a time on the screen
B) one character at a time
C) result on the screen
D) None of the above
July 7, 2021 in C and CPP
1.5 The value of S[5] in the segment char s[15] = “ MICROPROCESSOR” is
A) P
B) O
C) R
D) None of the above
July 7, 2021 in C and CPP
1.4 Which of the following is a wrong pointer declaration?
A) int *int(a);
B) int *x, *y;
C) float *aptr;
D) int *x, float *y;
July 7, 2021 in C and CPP
1.3 Which of the following is not a proper storage class in ‘C’?
A) auto
B) dec
C) static
D) extern
July 7, 2021 in C and CPP
1.2 What will be the output of the following program?
Main()
{ int x = 5;
While ( x = = 1)
x = x -1;
printf ( “ %d\n”, x);
}
A) 5
B) 4
C) 0
D) syntax error
July 7, 2021 in C and CPP
1.1 Which of the following is not an unconditional control statement in ‘C’?
A) break
B) continue
C) exit()
D) while
July 7, 2021 in C and CPP
a) Define a structure that describes a hotel. It should have members that include the name,
address, grade, average room charge and number of rooms.
Write a function to perform the following tasks.
i) To print all hotels details of a given grade in order of charges.
ii) To print hotel details with room charges less than given values.
b) What are the disadvantages of nested if-else statement?
July 7, 2021 in C and CPP
c) Define a two dimensional array ‘int a[10][10]’. Write a ‘C’ program to initialize this array with numbers between 0 and 99. Then print the contents of ‘a’.
July 7, 2021 in C and CPP
b) What are command line arguments? Explain with the help of a suitable example.