Online Test

:

 

What is the output of the following program?

#include
void main()
{
        char c[]="gate2015";
        char *p=c;
        printf("%s",p+p[3]-p[1]);
}

What is the output of this C code?

  #include <stdio.h>
    union p
    {
        int x;
        float y;
    };
    int main()
    {
        union p p, b;
        p.x = 10;
        printf("%f\n", p.y);
    }

Which of the following are incorrect declarations?


Point out the error in the program?

struct emp
{
    int ecode;
    struct emp e;
};

 For which of the following, “PI++;” code will fail?


Which of the following statements are true?
    P. Pointer to Array
    Q. Multi-dimensional array


What do the following declaration signify?

char *arr[10];

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

#include<stdio.h>
double i;
int main()
{
    (int)(float)(char) i;
    printf("%d", sizeof((int)(float)(char)i));
    return 0;
}

In which stage the following code 
#include<stdio.h> 
gets replaced by the contents of the file stdio.h


Point out the error in the program?

#include<stdio.h>

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

    printf("%d\n", sizeof(bit));
    return 0;
}

What is the purpose of fflush() function.


Point out the error in the following program (in Turbo C under DOS).

#include<stdio.h>
union emp
{
    int empno;
    int age;
};
int main()
{
    union emp e = {10, 25};
    printf("%d %d", e.empno, e.age);
    return 0;
}

What is the output of this C code?

    #include <stdio.h>
    #define a 10
    int main()
    {
        const int a = 5;
        printf("a = %d\n", a);
    }

Point out the error in the program?

typedef struct data mystruct;
struct data
{
    int x;
    mystruct *b;
};

What will be the output of the program?

#include<stdio.h>
int main()
{
    int i;
    i = printf("How r u\n");
    i = printf("%d\n", i);
    printf("%d\n", i);
    return 0;
}
 

About Us

TechEpi.com is an online learning website.We cover the latest tech news,online tutorials,blog,online test for Aptitude,C,Java,PHP to improve your knowledge.

Newsletter


Follow TechEpi on