echo '' ;
C Programming Language

C Quiz-3

Participating in a C quiz can offer several benefits for individuals looking to improve their programming skills and knowledge of the C programming language. Here are some potential advantages:

  1. Competition and Motivation: Quizzes with a competitive element can motivate participants to strive for better performance. Healthy competition can encourage individuals to push themselves and learn more to achieve higher scores.
  2. Feedback and Learning Opportunities: After completing a quiz, participants typically receive feedback on their performance. This feedback can include explanations for correct and incorrect answers, providing valuable learning opportunities.

C Quiz 01 to 07

Ques 1: What is the output of the following code?

#include "stdio.h"
extern int a;
main()
{
    printf("\na=%d",a);
    return 0;
}

(A) a=0

(B) a=garbage value

(C) error

(D) none of these

(C) Error



Ques 2: What is the output of the following program?

void main()
{
    int a;
    a=10;
    while(a++<=15)
    printf("%d",a);
    printf("%d",a+10);

(A) 10 11 12 13 14 15 16

(B) 11 12 13 14 15 16 27

(C) 10 11 12 13 14 15 25

(D) 11 11 12 13 14 15 25

(B)11 12 13 14 15 16 27



Ques 3: What is the output of the following program?

void main()
{
    printf("%d%d%d",-10^9, -10|9, -10&9);
}

(A) 1 1 0

(B) 1 0 1

(C) -1 0 0

(D) -1 -1 0

(C) -1 -1 0



Ques 4: What value of c will get printed

main()
{
    int a, b, c;
    a = 10;
    b = 20;
    c = printf("%d",a) + ++b;
    printf ("%d",c);
}

(A) 23

(B) 22

(C) 30

(D) Compilation Error

It will Print 10 23



Ques 5: What will be the output when you execute the following c  code?

#include<stdio.h>
{
    char arr[11]="The African Queen";
    printf("%s", arr);
    return 0;
}

Choose all that

(A) The African

(B) The

(C) Compilation Error

(D) None of the aboce

(C) Compilation Error



Ques 6: What is the output of the following program?

void f1()
{
    int a=0;
    ++a;
    printf("%d",a);
}

main()
{
    int a=10;
    f1();
    f1();
    f1();
    printf("%d",a);
    return 0;
}

(A) 0 1 1 10

(B) 10 0 1 10

(C) 1 2 3 4

(D) 1 1 1 10

(A) 1 1 1 10



Ques 7: What is the output of the following program?

void main()
{
    int a=89;
    int p;
    p=&a;
    *(int*)p=8;
    printf("%d",a);
    return 0;

(A) 7

(B) 8

(C) 89

(D) error

(D) Error



C Quiz 08 to 14

Ques 8: What will be the output of the following program?

void convention(int,int,int);

int main()
{
    int a=5;
    convention(a,++a,a++);
    return 0;
}

void  convention(int p,int q,int r)
{
    printf("%d %d %d",p,q,r);
}

(A) 5 6 5

(B) 6 7 5

(C) 7 7 5

(D) 6 6 5

(C) 7 7 5



Ques 9 :

What will be the output of the following program?

main()
{
    printf("%c","Pskills"[4]);
}

(A) Compilation Error

(B) P

(C) i

(D) 1

(D) 1



Ques 10: What is the output of the following program?

void main()
{
    float a;
    a=8.5;
    if(a==8.5)
     printf("1");
    else
     printf("2");
}

(A) 1

(B) 2

(C) error

(D) none of these

(A) 1



Ques 11: Which of the following program structure/component/statement is not an example of the implementation of modularization?

(A) DLL

(B) Functions

(C) type casting

(A) DLL



Ques 12 :

What will be output when you execute the following code?

void main()
{
    printf("%d",10?0?20?35:45:55:65);
}

(A) 35

(B) 45

(C) 55

(D) 65

(C) 55



Ques 13 :

How many times the while loop will get executed?

main ( )
{
    int a = 1 ;
    while ( a <= 100) ;
    {
        printf ( "%d", a++ ) ;
    }
}

(A) 100

(B) 1

(C) 0

(D) Infinite

(D) Infinite



Ques 14: What is the output of the following program?

void main()
{
    int a,b;
    a=b=1;
    a=a++ + ++b;
    b=b++ + ++a;
    printf("%d%d",a,b);
}

(A) 4 7

(B) 5 7

(C) 4 6

(D) 5 8

(C) 4 6



C Quiz 15 to 20

Ques 15 :

What will be the output of the following program?

#include<stdio.h>
int main()
{
    int x;
    x=10,20,30;
    printf("%d",x);
    return 0;
}

(A) 10

(B) 30

(C) 30

(D) 0

(A) 10



Ques 16: What is the output of the following code?

#include "stdio.h"
extern int a;
main()
{
    void fun();
    printf("\n a=%d",a);
    fun();
    return 0;
}

int a=7;

void fun()
{
    printf("\n in fun a=%d",a);
}

(A) a=0 in fun a=0

(B) a=7 in fun a=7

(C) a=7 in fun a=0

(D) error

(A) a=7 in fun a=7



Ques 17: what is the output of the following program?

void main()
{
    float a;
    a=6.7;
    if(a==6.7)
        printf("A");
    else
        printf("B");
}

(A) A

(B) B

(C) error

(D) nothing is displayed on the screen

(B) B



Ques 18: What is the output of the following program?

void f1()
{
    static int s=5;
    ++s;
    printf("%d",s);
}

main()
{
    f1();
    f1();
    printf("%d",s);
}

(A) 6 6 6

(B) 6 7 7

(C) 6 7 6

(D) error

(D) Error



Ques 19: What is the output of the following code?

#include"stdio.h"
main()
{
    int i;
    for(i=0;i<5;i++)
    {
        static int a=0;
        int b=0;
        a++;
        b++;
        printf("%d  %d",a,b);
    }
    return 0;
}

(A) 1 1 2 1 3 1 4 1

(B) 1 1 2 1 3 1 4 1 5 1

(C) 1 0 2 0 3 1 4 1 5 1

(D) 0 1 2 0 3 1 4 1 5 1

(B) 1 1 2 1 3 1 4 1 5 1



Ques 20: what is the output of the following program?

void main()
{
    printf("One");
    if(2>1)
        printf("Two");
    else
        printf("Three");
        printf("Four");
}

(A) One Two Three

(B) Two Three Four

(C) One Two Four

(D) One Three Four

(C) One Two Four



Next

It’s important to note that while quizzes can be beneficial, they are just one aspect of a comprehensive learning strategy. Practical application, hands-on coding, and building projects are equally important for mastering C programming or any programming language.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from ArunEworld

Subscribe now to keep reading and get access to the full archive.

Continue reading