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 statement declaring array is invalid. The code is erroneous since the values of array are getting scanned through the loop. The code is correct and runs successfully. None of these TRUE ANSWER : ? YOUR ANSWER : ?
Choose the best answer.Prior to using a pointer variable It should be both declared and initialized. It should be initialized. None of these. It should be declared. TRUE ANSWER : ? YOUR ANSWER : ?
What will be output if you will compile and execute the following c code?#include<stdio.h>#define max 5void main(){ int i = 0; i = max++; printf("%d", i++);} 0 7 Compiler Error 6 5 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following function is more appropriate for reading in a multi-word string? puts() None of these scanf() printf() gets() TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ int c = - -2; printf("c=%d", c);} Error -2 2 1 TRUE ANSWER : ? YOUR ANSWER : ?
What is the base data type of a pointer variable by which the memory would be allocated to it? int float unsigned int No data type Depends upon the type of the variable to which it is pointing. TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ char a[]="12345"; int i = strlen(a); printf("%d", ++i);} None of These 6 5 7 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the given program?#include<stdio.h>void main(){int a=11,b=5;if(a=5) b++;printf("%d %d", ++a, b++);} 5 6 11 6 6 6 6 7 12 7 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following program?void main(){ char str1[] = "abcd"; char str2[] = "abcd"; if(str1==str2) printf("Equal"); else printf("Unequal");} None of these. Error Equal Unequal TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:#include<stdio.h>#define clrscr() 100void main(){ clrscr(); printf("%dn", clrscr());} 0 100 Error 1 TRUE ANSWER : ? YOUR ANSWER : ?