Quizzes

Check your fundamentals by attempting following Quizzes





C Programming Quiz - 1 (1st October 2016)


1. Predict the output:

int main()
{
            int number[5]={1,2,3,4,5};
            printf("%d\n", number[5]);
            return 0;
}

A. 5
B. 0
C. Error
D. Any random number


2. Predict the output:

int main(){
            int matrixA[3][3]={};
            printf("MatrixA[1][0] = %d\n",  matrixA[1][0] );
            return 0;
}
A. 0
B. 3
C. Error
D. 10


3. Predict the output:

#include<stdio.h>
#include<string.h>
int main()
{
            char str1[10]="abc", str2[10]="xyz", str3[10]="pqr", str4[10];
            printf("%s",strcat(strcat(strcpy(str4, str3),str1),str2));
            return 0;
}
A. pqrabcxyz
B. pqrxyz
C. abcxyzpqr
D. Error


4. Predict the output:

#include<stdio.h>
int main(){
    char *p, str[10]="Ahmedabad";
    p = &str;
    printf("%c",*p+1);
    return 0;
}
A. A
B. h
C. m
D. B


5. Predict the output:

#include<stdio.h>
void main(){
    char arr[10]="The Indian Programmers";
    printf("%s",arr);
}
A. The Indian
B. The Indian Programmers
C. The
D. None of these





Keep visiting this page for more Quizzes. More Quizzes will be posted soon.

* * * * *




No comments:

Post a Comment