Q.1.

Point out the error in the program?

#include<stdio.h>

int main()
{
    struct emp
    {
        char name[20];
        float sal;
    };
    struct emp e[10];
    int i;
    for(i=i<=i++)
        scanf("%s %f", e[i].name, &e[i].sal);
    return}
Q.2.

How will you free the allocated memory ?

Q.3.

Point out the error in the program?

#include<stdio.h>

int main()
{
    struct emp
    {
        char name[25];
        int age;
        float bs;
    };
    struct emp e;
    e.name = "Suresh";
    e.age =    printf("%s %d\n", e.name, e.age);
    return}
Q.4.

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

#include<stdio.h>

int main()
{
    struct emp
    {
        char *n;
        int age;
    };
    struct emp e1 = {"Dravid", 23};
    struct emp e2 = e    strupr(e2.n);
    printf("%s\n", e1.n);
    return}
Q.5.

Point out the error in the program?

#include<stdio.h>

int main()
{
    struct emp
    {
        char n[20];
        int age;
    };
    struct emp e1 = {"Dravid", 23};
    struct emp e2 = e    if(e1 == e        printf("The structure are equal");
    return}
Q.6.

The '->' operator can be used to access structures elements using a pointer to a structure variable only

Q.7.

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

Q.8.

What will be the output of the program in 16-bit platform (under DOS)?

#include<stdio.h>

int main()
{
    struct node
    {
        int data;
        struct node *link;
    };
    struct node *p, *q;
    p = (struct node *) malloc(sizeof(struct node));
    q = (struct node *) malloc(sizeof(struct node));
    printf("%d, %d\n", sizeof(p), sizeof(q));
    return}
Q.9.

Point out the error in the program?

#include<stdio.h>

int main()
{
    struct bits
    {
        float f:    }bit;

    printf("%d\n", sizeof(bit));
    return}
Q.10.

It is not possible to create an array of pointer to structures.

Q.11.

A union cannot be nested in a structure

Q.12.

Can a structure can point to itself?

Q.13.

Is there easy way to print enumeration values symbolically?

Q.14.

If the following structure is written to a file using fwrite(), can fread() read it back successfully?

struct emp
{
    char *n;
    int age;
};
struct emp e={"IndiaBIX", 15};
FILE *fp;
fwrite(&e, sizeof(e),fp);
Q.15.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    union var
    {
        int a, b;
    };
    union var v;
    v.a=    v.b=    printf("%d\n", v.a);
    return}
Q.16.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    struct byte
    {
        int one:    };
    struct byte var = {1};
    printf("%d\n", var.one);
    return}
Q.17.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    union var
    {
        int a, b;
    };
    union var v;
    v.a=    v.b=    printf("%d\n", v.a);
    return}
Q.18.

Nested unions are allowed

Q.19.

If a char is 1 byte wide, an integer is 2 bytes wide and a long integer is 4 bytes wide then will the following structure always occupy 7 bytes?

struct ex
{
    char ch;
    int i;
    long int a;
};
Q.20.

By default structure variable will be of auto storage class