Online Test

:

 

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 is the output of the following program?

#include<stdio.h>
void main()
{
        int x=10,y=20;
        x=((x>9) && y=30 ? printf("\nTRUE"): printf("\nFALSE"));
        printf("\ny=%d",y);
}

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

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

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


What will be the output of the program?

#include<stdio.h>
#include<stdlib.h>
int main()
{
    char *i = "55.555";
    int result1 = 10;
    float result2 = 11.111;
    result1 = result1+atoi(i);
    result2 = result2+atof(i);
    printf("%d, %f", result1, result2);
    return 0;
}

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

What do the following declaration signify?

char *arr[10];

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


Point out the error in the program?

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

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

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


 Which operator connects the structure name to its member name?


What is the output of below c program?

#include<stdio.h>
int main()
{
  displayOut();
  return 0;
}
int displayOut()
{
  printf("Hi from techepi.com\n");
}
 

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