What is the right choice, if the following loop is implemented?void main(){ int num = 0; do{ --num; printf("%d", num); }while( ++num >= 0 );} There will be a compilation error reported. The program will not enter into the loop. The loop will run infinitely many times. A run time error will be generated. Prints the value of 0 one time only. TRUE ANSWER : ? YOUR ANSWER : ?
Which command is used to skip the rest of a loop and carry on from the top of the loop again? skip continue break None of these resume TRUE ANSWER : ? YOUR ANSWER : ?
Let x be an array. Which of the following operations are illegal?I. ++xII. x+1III. x++IV. x*2 I, II and III III and IV I and II II and III I, III and IV TRUE ANSWER : ? YOUR ANSWER : ?
The library function used to find the last occurrence of a character in a string is laststr() strnstr() strstr() strrchr() None of these TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ char *str1 = "abcd"; char str2[] = "abcd"; printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));} 2 5 5 2 4 5 5 5 5 2 4 4 TRUE ANSWER : ? YOUR ANSWER : ?
What will be printed after compiling and running the following code?main() { char *p; printf("%d %d",sizeof(*p), sizeof(p));} 2 2 1 2 1 1 2 1 TRUE ANSWER : ? YOUR ANSWER : ?
Find the output of the following program.#include<stdio.h>void main(){ int y=10; if(y++>9 && y++!=10 && y++>11) printf("%d", y); else printf("%d", y);} Compilation error 12 13 11 14 TRUE ANSWER : ? YOUR ANSWER : ?
Consider the following type definition.typedef char x[10];x myArray[5];What will sizeof(myArray) be ? (Assume one character occupies 1 byte) 15 None of these 10 30 50 TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ char *p; printf("%d %d", sizeof(*p), sizeof(p));} 1 1 2 2 2 1 1 2 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following statements are correct about the program below?#include<stdio.h>void main(){ int size, i; scanf("%d", &size); int arr[size]; for(i=1; i<=size; i++) { scanf("%d", arr[i]); printf("%d", arr[i]); }} The code is erroneous since the subscript for array used in for loop is in the range 1 to size. The code is erroneous since the values of array are getting scanned through the loop. The code is erroneous since the statement declaring array is invalid. The code is correct and runs successfully. None of these TRUE ANSWER : ? YOUR ANSWER : ?