Q.1

Is it true that a global variable may have several declarations, but only one definition?

  • Yes
  • No
Q.2

Point out the error in the following program.

#include<stdio.h>
int main()
{
    int (*p)() = fun;
    (*p)();
    return}
int fun()
{
    printf("IndiaBix.com\n");
    return}
  • Error: in int(*p)() = fun;
  • Error: fun() prototype not defined
  • No error
  • None of these
Q.3

What will be the output of the program?

#include<stdio.h>
int X=
int main()
{
    int X=
    printf("%d\n", X);
    return
}
  • 20
  • 40
  • Error
  • No Output
Q.4

Which of the structure is correct?

1 :
struct book
{
    char name[10];
    float price;
    int pages;
};
2 :
struct aa
{
    char name[10];
    float price;
    int pages;
}
3 :
struct aa
{
    char name[10];
    float price;
    int pages;
}
  • 1
  • 2
  • 3
  • All of above
Q.5

Is it true that a function may have several declarations, but only one definition?

  • Yes
  • No
Q.6

In the following program how long will the for loop get executed?

#include<stdio.h>
int main()
{
    int i=    for(;scanf("%s", &i); printf("%d\n", i));
    return}
  • The for loop would not get executed at all
  • The for loop would get executed only once
  • The for loop would get executed 5 times
  • The for loop would get executed infinite times
Q.7

What is the output of the program given below ?

#include<stdio.h>
int main()
{
    enum status { pass, fail, atkt};
    enum status studstudstud    stud1 = pass;
    stud2 = atkt;
    stud3 = fail;
    printf("%d, %d, %d\n", studstudstud3);
    return}
  • 0, 1, 2
  • 1, 2, 3
  • 0, 2, 1
  • 1, 3, 2
Q.8

By default a real number is treated as a

  • float
  • double
  • long double
  • far double
Q.9

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

  • rem = 3.14 % 2.1;
  • rem = modf(3.14, 2.1);
  • rem = fmod(3.14, 2.1);
  • Remainder cannot be obtain in floating point division.
Q.10

What will be the output of the program?

#include<stdio.h>
int main()
{
    int X=
    {
        int X=
        printf("%d ", X);
    }
    printf("%d\n", X);
    return
}
  • 40 40
  • 20 40
  • 20
  • Error
Q.11

What is the output of the program

#include<stdio.h>
int main()
{
    int x =y =z =i;
    i = x < y < z;
    printf("%d\n", i);
    return}
  • 0
  • 1
  • Error
  • None of these
Q.12

What will be the output of the program inbit platform (Turbo C under DOS)?

#include<stdio.h>
int main()
{
    extern int i;
    i =    printf("%d\n", sizeof(i));
    return}
  • 2
  • 4
  • vary from compiler
  • Linker Error : Undefined symbol 'i'
Q.13

Which of the following is not user defined data type?

1 :
struct book
{
    char name[10];
    float price;
    int pages;
};
2 :
long int l = 2.35;
3 :
enum day {Sun, Mon, Tue, Wed};
  • 1
  • 2
  • 3
  • Both 1 and 2
Q.14

What are the types of linkages?

  • Internal and External
  • External, Internal and None
  • External and None
  • Internal
Q.15

What is the output of the program

#include<stdio.h>
int main()
{
    extern int fun(float);
    int a;
    a = fun(3.14);
    printf("%d\n", a);
    return}
int fun(int aa)
{
	return (int)++aa;
}
  • 3
  • 3.14
  • 4
  • Compile Error
Q.16

What is the output of the program?

#include<stdio.h>
int main()
{
    extern int a;
    printf("%d\n", a);
    return}
int a=
  • 20
  • 0
  • Garbage Value
  • Error
Q.17

Is the following statement a declaration or definition?
extern int i;

  • Declaration
  • Definition
  • Function
  • Error
Q.18

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

  • * (asterisk)
  • | (pipeline)
  • - (hyphen)
  • _ (underscore)
Q.19

What is the output of the program

#include<stdio.h>
int main()
{
    int a[= {3};
    printf("%d, %d, %d\n", a[2], a[3], a[4]);
    return
}
  • Garbage Values
  • 2, 3, 3
  • 3, 2, 2
  • 0, 0, 0
Q.20

What is the output of the program in Turbo C (in DOS 16-bit OS)?

#include<stdio.h>
int main()
{
    char *s    char far *s    char huge *s    printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));
    return}
  • 2, 4, 6
  • 4, 4, 2
  • 2, 4, 4
  • 2, 2, 2
0 h : 0 m : 1 s