Online Test

:

 

Point out the error in the program?

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

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;
}

What do the following declaration signify?

char *arr[10];

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


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);
    }

What is the output of the following program?

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

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 ouput of below c program?

#include<stdio.h>
int main()
{
    printf("Techepi");
    main();
    return 0;
}

What is the purpose of fflush() function.


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\n", stud1, stud2, stud3);
    return 0;
}

What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile?

#include<stdio.h>
#define SWAP(a, b, c)(c t; t=a, a=b, b=t)
int main()
{
    int x=10, y=20;
    SWAP(x, y, int);
    printf("%d %d\n", x, y);
    return 0;
}

Which of the following are incorrect declarations?


What will be the output of the program?

#include<stdio.h>
typedef struct error {int warning, err, exception;} ERROR;
int main()
{
    ERROR e;
    e.err=1;
    printf("%d\n", e.err);
    return 0;
}

What will the function rewind() do?


What is the output of the following program?

#include<stdio.h>
void main()
{
        printf(4+"TechEpi\t");
        printf("TechEpi"+4);
}

What will be the output of the program?

#include<stdio.h>
int main()
{
    typedef int LONG;
    LONG a=4;
    LONG b=68;
    float c=0;
    c=b;
    b+=a;
    printf("%d,", b);
    printf("%f\n", c);
    return 0;
}

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;
}

Which bitwise operator is suitable for turning off a particular bit in a number?


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);
    }

What will be the output of the program?

#include<stdio.h>
#define MAN(x, y) ((x)>(y)) ? (x):(y);
int main()
{
    int i=10, j=5, k=0;
    k = MAN(++i, j++);
    printf("%d, %d, %d\n", i, j, k);
    return 0;
}

Declare the following statement?
"A pointer to a function which receives nothing and returns nothing".


Point out the error in the program?

#include<stdio.h>
int main()
{
    struct a
    {
        float category:5;
        char scheme:4;
    };
    printf("size=%d", sizeof(struct a));
    return 0;
}

What is the output of below c program?

#include<stdio.h>
int main()
{
  struct student
  {
    int id;
    char *name;
   };
   struct student *a,b
   a->id=20;
   a->name="TechEpi";
   printf("%d,%s",a->id,a->name);
}

Point out the error in the program?

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

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

 

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