Which of the following statements should be used to obtain a remainder after dividing 3.14 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.
What is the output of the program given below ?
#include<stdio.h>
int main()
{
    enum status { pass, fail, atkt};
    enum status stud1, stud2, stud3;
    stud1 = pass;
    stud2 = atkt;
    stud3 = fail;
    printf("%d, %d, %d", stud1, stud2, stud3);
    return 0;
}

0, 1, 2
1, 2, 3
0, 2, 1
1, 3, 2
Point out the error in the following program.
#include<stdio.h>
int main()
{
    display();
    return 0;
}
void display()
{
    printf("ASTIWZ.com");
}

No error
display() doesn't get invoked
display() is called before it is defined
None of these
Which of the definition is correct?

int length;
char int;
int long;
float double;
A long double can be used if range of a double is not enough to accommodate a real number.

True
False
Is there any difference int the following declarations?
int myfun(int arr[]);
int myfun(arr[20]);

Yes
No
What are the types of linkages?

Internal and External
External, Internal and None
External and None
Internal
What will be the output of the program in 16 bit platform (Turbo C under DOS)?
#include<stdio.h>
int main()
{
    extern int i;
    i = 20;
    printf("%d", sizeof(i));
    return 0;
}

2
4
vary from compiler
Linker Error : Undefined symbol 'i'
Point out the error in the following program.
#include<stdio.h>
int main()
{
    void v = 0;

    printf("%d", v);

    return 0;
}

Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.
Program terminates abnormally.
No error.
None of these.
Which of the following operations are INCORRECT?

int i = 35; i = i%5;
short int j = 255; j = j;
long int k = 365L; k = k;
float a = 3.14; a = a%3;
A float is 4 bytes wide, whereas a double is 8 bytes wide.

True 
False 
Suppose a program is divided into three files f1, f2 and f3, and a variable is defined in the file f1 but used in files f2 and f3. In such a case would we need the extern declaration for the variables in the files f2 and f3?

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

* (asterisk)
| (pipeline)
- (hyphen)
_ (underscore)
What is the output of the program?
#include<stdio.h>
int main()
{
    extern int a;
    printf("%d", a);
    return 0;
}
int a=20;

20
0
Garbage Value
Error
Point out the error in the following program.
#include<stdio.h>
struct emp
{
    char name[20];
    int age;
};
int main()
{
    emp int xx;
    int a;
    printf("%d", &a);
    return 0;
}

Error: in printf
Error: in emp int xx;
No error.
None of these.
Which of the following correctly represents a long double constant?

6.68
6.68L
6.68f
6.68LF
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.

True
False
Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.

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

Both are identical
No difference, except extern int fun(); is probably in another file
int fun(); is overrided with extern int fun();
None of these
What is the output of the program in Turbo C (in DOS 16-bit OS)?
#include<stdio.h>
int main()
{
    char *s1;
    char far *s2;
    char huge *s3;
    printf("%d, %d, %d", sizeof(s1), sizeof(s2), sizeof(s3));
    return 0;
}

2, 4, 6
4, 4, 2
2, 4, 4
2, 2, 2
Which of the following is correct about err used in the declaration given below?
 typedef enum error { warning, test, exception } err;

It is a typedef for enum error.
It is a variable of type enum error.
The statement is erroneous.
It is a structure.
Which of the structure is incorrcet?
1 :
struct aa
{
    int a;
    float b;
};
2 :
struct aa
{
    int a;
    float b;
    struct aa var;
};
3 :
struct aa
{
    int a;
    float b;
    struct aa *var;
};

1
2
3
1, 2, 3
Size of short integer and long integer can be verified using the sizeof() operator.

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

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

ceil(1.66)
floor(1.66)
roundup(1.66)
roundto(1.66)
What is the output of the program
#include<stdio.h>
int main()
{
    struct emp
    {
        char name[20];
        int age;
        float sal;
    };
    struct emp e = {"Tiger"};
    printf("%d, %f", e.age, e.sal);
    return 0;
}

0, 0.000000
Garbage values
Error
None of above
Point out the error in the following program.
#include<stdio.h>
int main()
{
    int (*p)() = fun;
    (*p)();
    return 0;
}
int fun()
{
    printf("ASTIWZ.com");
    return 0;
}

Error: in int(*p)() = fun;
Error: fun() prototype not defined
No error
None of these
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
Range of double is -1.7e-38 to 1.7e+38

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

Yes
No
By default a real number is treated as a

float
double
long double
far double
What will be the output of the program?
#include<stdio.h>
int X=40;
int main()
{
    int X=20;
    printf("%d", X);
    return 0;
}

20
40
Error
No Output

1: typedef long a;
    extern int a c;

2: typedef long a;
    extern a int c;

3: typedef long a;
    extern a c;

1 correct
2 correct
3 correct
1, 2, 3 are correct
Size of short integer and long integer would vary from one platform to another.

True
False
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
What is the output of the program
#include<stdio.h>
int main()
{
    int x = 10, y = 20, z = 5, i;
    i = x < y < z;
    printf("%d", i);
    return 0;
}

0
1
Error
None of these
Range of float id -2.25e-308 to 2.25e+308

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

Declaration
Definition
Function
Error
What is the output of the program
#include<stdio.h>
int main()
{
    extern int fun(float);
    int a;
    a = fun(3.14);
    printf("%d", a);
    return 0;
}
int fun(int aa)
{
    return (int)++aa;
}

3
3.14
Compile Error
Identify which of the following are declarations
1 : extern int x;
2 : float square ( float x ) { ... }
3 : double pow(double, double);

1
2
1 and 3
3
What is the output of the program
#include<stdio.h>
int main()
{
    int a[5] = {2, 3};
    printf("%d, %d, %d", a[2], a[3], a[4]);
    return 0;
}

Garbage Values
2, 3, 3
3, 2, 2
0, 0, 0
In the following program where is the variable a getting defined and where it is getting declared?
#include<stdio.h>
int main()
{
    extern int a;
    printf("%d", a);
    return 0;
}
int a=20;

extern int a is declaration, int a = 20 is the definition
int a = 20 is declaration, extern int a is the definition
int a = 20 is definition, a is not defined
a is declared, a is not defined
What is the output of the program
#include<stdio.h>
int main()
{
    union a
    {
        int i;
        char ch[2];
    };
    union a u;
    u.ch[0] = 3;
    u.ch[1] = 2;
    printf("%d, %d, %d", u.ch[0], u.ch[1], u.i);
    return 0;
}

3, 2, 515
515, 2, 3
3, 2, 5
None of these
When we mention the prototype of a function?

Defining
Declaring
Prototyping
Calling
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", i));
    return 0;
}

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
What will be the output of the program?
#include<stdio.h>
int main()
{
    int X=40;
    {
        int X=20;
        printf("%d ", X);
    }
    printf("%d", X);
    return 0;
}

40 40
20 40
20
Error
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", i));
    return 0;
}

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
What will be the output of the program?
#include<stdio.h>
int main()
{
    int X=40;
    {
        int X=20;
        printf("%d ", X);
    }
    printf("%d", X);
    return 0;
}

40 40
20 40
20
Error