• CALL US: +91-8561868421
  • Address: Plont No 67 OM Shiv Colony Jhotwara Jaipur-12

C Language Quiz

(Total Question : 57)

Q.1

Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

Q.2

What are the types of linkages?

Q.3

Which of the following special symbol allowed in a variable name?

Q.4

Is there any difference between following declarations?
1 : extern int fun();
2 : int fun();

Q.5

How would you round off a value from 1.66 to 2.0?

Q.6

By default a real number is treated as a

Q.7

When we mention the prototype of a function?

Q.8

A long double can be used if range of a double is not enough to accommodate a real number.

Q.9

A float is 4 bytes wide, whereas a double is 8 bytes wide.

Q.10

If the definition of the external variable occurs in the source file before its use in a particular function, then there is no need for an extern declaration in the function.

Q.11

How many times \"tutorial44\" is get printed?
#include<stdio.h>
int main()
{
    int x;
    for(x=-1; x<=10; x++)
    {
        if(x < 5)
            continue;
        else
            break;
        printf(\"tutorial44\");
    }
    return 0;
}

Q.12

How many times the while loop will get executed if a short int is 2 byte wide?
#include<stdio.h>
int main()
{
    int j=1;
    while(j <= 255)
    {
        printf(\"%c %d\\n\", j, j);
        j++;
    }
    return 0;
}

Q.13

Which of the following is not logical operator?

Q.14

In mathematics and computer programming, which is the correct order of mathematical operators ?

Q.15

Which of the following cannot be checked in a switch-case statement?

Q.16

What will be the output of the program?
#include<stdio.h>
int main()
{
    int i=0;
    for(; i<=5; i++);
        printf(\"%d\", i);
    return 0;
}

Q.17

What will be the output of the program?
#include<stdio.h>
int main()
{
    unsigned int i = 65535; /* Assume 2 byte integer*/
    while(i++ != 0)
        printf(\"%d\",++i);
    printf(\"\\n\");
    return 0;
}

Q.18

A short integer is at least 16 bits wide and a long integer is at least 32 bits wide.

Q.19

If scanf() is used to store a value in a char variable then along with the value a carriage return(\\r) also gets stored it.

Q.20

The modulus operator cannot be used with a long double.

Q.21

Which of the following correctly shows the hierarchy of arithmetic operations in C?

Q.22

The keyword used to transfer control from a function back to the calling function is

Q.23

How many times the program will print "tutorial44" ?
#include<stdio.h>int main(){    printf("tutorial44");    main();    return 0;}

Q.24

A function cannot be defined inside another function

Q.25

Functions cannot return more than one value at a time

Q.26

If return type for a function is not specified, it defaults to int

Q.27

In C all functions except main() can be called recursively.

Q.28

Functions can be called either by value or reference

Q.29

Functions cannot return a floating point number

Q.30

Every function must return a value

Q.31

What is (void*)0?

Q.32

In which header file is the NULL macro defined?

Q.33

How many bytes are occupied by near, far and huge pointers (DOS)?

Q.34

Are the expression *ptr++ and ++*ptr are same?

Q.35

Are the three declarations char **apple, char *apple[], and char apple[][] same?

Q.36

What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

Q.37

How will you free the allocated memory ?

Q.38

In C, if you pass an array as an argument to a function, what actually gets passed?

Q.39

A pointer to a block of memory is effectively same as an array

Q.40

Does this mentioning array name gives the base address in all the contexts?

Q.41

Are the expressions arr and &arr same for an array of 10 integers?

Q.42

What is the similarity between a structure, union and enumeration?

Q.43

Point out the error in the program?
struct emp
{
    int ecode;
    struct emp *e;
};

Q.44

A union cannot be nested in a structure

Q.45

Nested unions are allowed

Q.46

one of elements of a structure can be a pointer to the same structure.

Q.47

A structure can be nested inside another structure.

Q.48

size of union is size of the longest element in the union

Q.49

The elements of union are always accessed using & operator

Q.50

A pointer union CANNOT be created

Q.51

A function returns a value, whereas a subroutine cannot return a value.

Q.52

How many values is a subroutine capable of returning?

Q.53

Which of the following CANNOT occur multiple number of times in a program?

Q.54

A function can be used in an expression, whereas a subroutine cannot be.

Q.55

The this reference gets created when a member function (non-shared) of a class is called.

Q.56

Which of the following statements is correct about classes and objects in C#.NET?

Q.57

Can static procedures access instance data?