Knowledge check.

- Choose one best answer from given 4 choices for each questions.
- Review before submitting, as you won't get a chance to review after submitting.
- Max Time for quiz is 30 mins and Exam is 90 mins.
- Login is not required for an exam or a quiz.
- By submitting you formally acknowledge and accept terms and conditions mentioned here.

Question Number 1

Give the output of the following code snippet :
void main( )
{
    char c;
    c = getchar( );
    printf( "\nYou entered: ");
    putchar( c );
}

Assume input as 'c' :

Question Number 2

Give the output of the following code snippet :
void main()
{
    int a=13,b=20;
    if(!a==!b)
        printf("%d",++a);
    else
        printf("%d",--b);
}

Question Number 3

Which of the following is related to a Microsoft Development tool package.

Question Number 4

Give the output of the following code snippet :
struct student
{
    int no;
    char name[20];
}
void main()
{
    struct student s;
    s.no = 8;
    printf("Hello");
}

Question Number 5

Which of the keywords denote the size and type of a variable in C :

Question Number 6

Which of the following statements are used to alter the flow of control in a C program :

Question Number 7

Visual Studio is NOT

Question Number 8

Which is the function used to length of a string in C?

Question Number 9

Which of the following functions are available in the header file string.h in C?

Question Number 10

The nth element of an array arr[n] of n values is accessed by:

Question Number 11

Which of the following is a valid syntax for the sscanf() function?

Question Number 12

If the return type of a function is not mentioned, what is its default return type?

Question Number 13

Platforms and software supported by Visual Studio are,

Question Number 14

Which of the following statements is true about the setvbuf() function?

Question Number 15

Which is the header file used to help manipulate strings in C?

Question Number 16

Give the output of the following code snippet :
int main()
{
    int i=0;
    if(i--)
    {
        printf("%d",i++);
    }
    else
        printf("%d",--i);
    main();
}

Question Number 17

Which of the following functions are equivalent to the printf() function?

Question Number 18

Give the output of the following code snippet :
struct point
{
    int x;
    int y;
};
struct point fun()
{
    struct point temp = {1, 2};
    return temp;
}
int main()
{
    struct point p1 = {10};
    p1 = fun();
    printf("%d\n", p1.x);
}

Question Number 19

Free Edition of Visual Studio is,

Question Number 20

Which of the following are examples of built in functions?

Question Number 21

The steps to start a New Wizard in Visual Studio 2010 is,

Question Number 22

Which of the following are constituents of a C program :

Question Number 23

Give the output of the following C code:
void hello()
{
    printf("Welcome");
}


void main()
{
    hello();
    printf("I repeat");
    hello();
}

Question Number 24

Give the output of the following code snippet :
int i=10;
int func(int x)
{
    i++;
    return ++i;

}
int func2(int y)
{
    i=30;
    --i;
    return --i;
}
void main()
{
    int a=func(i);
    int b=func2(i);
    printf("%d",a*b);
}

Question Number 25

Give the output of the following code snippet :
void main( )
{
    printf("Hello,
           World ");
}

Question Number 26

Give the output of the following code :
void fun (int)
{
    printf("Hello");

}
void main()
{
    fun();
}

Question Number 27

Which of the keywords denote the size and type of a variable in C :

Question Number 28

How many arguments does the function fopen() take?

Question Number 29

Give the output of the following code snippet :
int func2(int y)
{
    if(y==1)
        return 1;
    int x=20;
    x+=func2(--y);
    return x;
}
void main()
{
    int i=10;
    int b=func2(i);
    printf("%d",b);
}

Question Number 30

Give the output of the following code snippet :
int main()
{
    int a = 0, i = 0;
    for (i = 0; i <  5; i++)
    {

        continue;
        a++;
    }
    printf("%d",a);
}

Question Number 31

Which function returns a non-zero value if the EOF indicator is set for file stream?

Question Number 32

Which of the following are keywords in C:

Question Number 33

What are the arguments passed to the fread() function?

Question Number 34

How many arguments does the fclose() function take?

Question Number 35

Which of the following is an example of looping in C?

Question Number 36

What is the green play button in the Visual studio does?

Question Number 37

Which of the following are the user interfaces that help to debug a program with Visual Studio:

Question Number 38

Give the output of the following code snippet : Assume the contents of the file 'Test.txt' is "Hello World".

void main()
{
    char x;
    FILE *fp;
    fp=fopen("Test.txt","r");
    while((x=getc(fp))!=EOF)
    {
        printf("%c",x);
    }
    fclose(fp);
}

Question Number 39

Give the output of the following code snippet :

int main()
{
    while(0)
    {
        printf("Hello world");
    }
    return 0;
}

Question Number 40

Which of the following operators performs the same function of the logical NOT operator?

Question Number 41

Which of the following are not features of Debugging with Visual Studio :

Question Number 42

The breakpoint pauses the execution

Question Number 43

Which of the keywords denote the size and type of a variable in C :

Question Number 44

Give the output of the following code snippet :
int main()
{
    struct student
    {
        char name[25];
        int age;
    };
    struct student e;
    strcpy(e.name,"Jenn");
    e.age = 25;
    printf("%s %d\n", e.name, e.age);
    return 0;
}

Question Number 45

Give the output of the following code snippet :
void main()
{
    int i=0;
    int sum=0;
    do
    {
        printf("%d",i);
        sum+=i;
    }
    while(i=1; i< 5; i++);
}

Question Number 46

Which mode is used to denote opening the text file for update?

Question Number 47

Give the output of the following code snippet :
void main()
{
    int x=25,y=1;
    do
    {
        if(x>5)
            printf(" One");
        else if(x>10)
            printf(" Two");
        else
            printf(" Three");
    }
    while(y--);
}

Question Number 48

Give the output of the following code snippet :
struct Point
{
    int x;
    int y;
};

int main()
{
    struct Point p1;
    struct Point p2 = p1;
    printf("%d  %d", p2.x, p2.y);
    getchar();
}

Question Number 49

What does the fread() function return?

Question Number 50

Give the output of the following code snippet :

void main()
{

    printf("Welcome");
    goto L2 ;

L1:

    printf("Loop 1");

L2:

    printf("Loop2");

    goto L1;
}

Question Number 51

When it comes to programming, the debugger is as helpful as the :

Question Number 52

Which is the function used to concatenate two strings in C?

Question Number 53

Which of the following are not user interfaces that help to debug a program with Visual Studio:

Question Number 54

Give the output of the following code snippet :

int main()
{
    register static int i = 10;
    i = 11;
    printf("%d\n", i);
}

Question Number 55

Which of the keywords denote the size and type of a variable in C :

Question Number 56

Give the output of the following code snippet :

int main()
{
    int i;
    for(i=0; i< =6; i++)
    {
        if(i <  3)
            continue;
        else
            printf("Test");
        break;

    }
    return 0;
}

Question Number 57

Which of the keywords denote the size and type of a variable in C :

Question Number 58

Give the output of the following code snippet :
void main()
{
    char new1[]="Welcome";
    printf (new1);
}

Question Number 59

Which mode is used to denote opening the text file for update where the writing is done at the end?

Question Number 60

Give the output of the following code snippet :
void main()
{
    int i=0,j;
    for(i=1,j=2;;)
    {
        i=i+2;
        if(i%j==0)
            continue;
        else
            break;
    }
    printf("%d",i);
}

Question Number 61

Among all the files that make up a source program, how many times can an external variable be defined?

Question Number 62

Which of the keywords denote the size and type of a variable in C :

Question Number 63

Write the given if else statements using conditional operator in C :
if (x <  y)
{
    min = x;
}
else
{
    min = y;
}

Question Number 64

Platforms and software supported by Visual Studio are,

Question Number 65

Give the output of the following code snippet :
int func(int a)
{
    int b=10;
    return a+++ ++b;
}
int main()
{
    int x=5;
    int z=func(func(func(func(5))));
    printf("%d",z);
}

Question Number 66

Give the output of the following code snippet :
int k()
{
    printf("Hello");
}
struct p
{
    int k();
    char c[10];

};
int main()
{
    struct p x;
    printf("%d",x.k());
}

Question Number 67

Give the output of the following code snippet :
void main()
{
    int i=0,j;
    for(i=-1,j=2; j< 5; j++)
    {
        if(j!=5)
            continue;
        else i++;
    }
    printf("%d",i);
}

Question Number 68

Give the syntax for the while loop to repeat the action while the condition is true in C :

Question Number 69

Give the output of the following code snippet :
int func(int a,int b)
{
    int z=a >= b?return (a= a/b): return (a=20%10) ;
}
int main()
{
    int a,b;
    a=func(100,250);
    b=func(20,20);
    printf("%d %d",a,b);
}

Question Number 70

Which of the following functions is used to set the file position for the stream?

Question Number 71

Give the output of the following code snippet when the file 'Test.txt' is not available :
void main()
{
    char x;
    FILE *fp;
    fp=fopen("Test.txt","r");
    if(fp==NULL)
    {
        printf("Fail");
        exit(0);
    }
    fclose(fp);
}

Question Number 72

Give the output of the following code snippet :
void main()
{
    int a=10;
    --a;
    switch(a--)
    {
    case 10 :
        printf("%d ",a);
        break;
    case 10*9/10  :
        printf("%d ",a++);
    case 11:
        printf("%d",a--);
        break;
    default:
        printf("Hello");
        break;
    }
}

Question Number 73

Find the output of the following program :
int main()
{
    char str[] = "Hello\0\World";
    printf("%s\n", str);
    return 0;
}

Question Number 74

Which of the following statements is true about the setvbuf() function?

Question Number 75

Give the output of the following code snippet :

int main()
{
    char c;
    FILE *fp;
    fp=fopen("myfile.txt","w");

    while((c=fgetc(fp))!=EOF)
        printf("%c",c);
    fclose(fp);
    return 0;
}

Assume the contents of file 'myfile.txt' contains " Hello world".

Question Number 76

Which of the keywords denote the size and type of a variable in C :

Question Number 77

Which of the following statements is true by the Call by value method?

Question Number 78

Give the output of the following code snippet :
void main()
{
    struct employee
    {
        int id;
    };
    struct employee emp1= {20};
    printf("%d\t",emp1.id);
}

Question Number 79

Which is the function key in VS is associated with stepping out of the function while debugging?

Question Number 80

What is the return-type of the function sqrt() in C?

Question Number 81

Which of the following is NOT related to a Microsoft Development tool package?

Question Number 82

Give the output of the following code snippet :
void main()
{
    int x=0,y=1,z=2;
    if((x==y)&(z==x+2))
        printf("%d",z);
    else
        printf("%d",++x);
}

Question Number 83

Which of the keywords denote the size and type of a variable in C :

Question Number 84

Which of the keywords denote the scope of a variable in C :

Question Number 85

Give the output of the following code snippet :
int main()
{
    while(1)
    {
        printf("Hello world");
    }
    return 0;
}

Question Number 86

Which mode is used to denote opening the binary file for writing but discards any previous contents if any?

Question Number 87

Give the output of the following code :
int main()
{
    char str1[] = "Hello";
    char str2[] = "Hello";
    if(str1 == str2)
        printf("Equal\n");
    else
        printf("Unequal\n");
    return 0;
}

Question Number 88

Give the output of the following code snippet :
struct student
{
    int id;
};
void main()
{
    struct student s[10];
    s[0].id = 10;
    printf("%d", s[0].id);
}

Question Number 89

Give the output of the following code snippet :
void main()
{
    struct temp
    {
        int a;
        char b;
        struct temp1
        {
            char c;
        } p;
    };
    struct temp t1 = {10,'A','e'};

    printf("%d %c %c ",t1.a,t1.b,t1.p.c);
}

Question Number 90

Give the output of the following code snippet :

void main()
{
    int n;
    for (n = 4; n!=0; n--)
        printf("%d ", n--);

}

Question Number 91

Give the output of the following code snippet :
void main()
{
    struct temp
    {
        int a;
        char b;
        struct temp1
        {
            char c;
        } p;
    };
    struct temp t1 = {10,'A','e'};

    printf("%d %c %c ",p.a,p.b,p.c);
}

Question Number 92

Give the output of the following code snippet :

void main()
{
    char new1[]= { 0 };
    strcpy(new1,"Jello");
    char new2[]= { 0 };
    strcpy(new2,"Yellow");
    char new3[]= { 0 };
    strcat(new3,new1);
    strcat(new3,new2);
    printf (new3);
}

Question Number 93

According to the presenter, to overcome the learning curve with Visual Studio, with ease, it’s better to

Question Number 94

Which of the following can be called between a read and a write operation in a file?

Question Number 95

Give the output of the following code snippet :
void main()
{
    int a;
    for(a=0; a< 5; a++)
    {
        if(a< 3)
            continue;
        else
            printf("Hello world");
    }
}

Question Number 96

What is a binary stream in C?

Question Number 97

Which of the following statements are used to alter the flow of control in a C program :

Question Number 98

Which of the following are parts of a function in C:

Question Number 99

Which of the following is related to a Microsoft Development tool package?

Question Number 100

What are the functions that are available to manipulate strings in C?

Question Number 101

Give the output of the following code snippet :
void main()
{
    char new1[]="Hi";
    for(int i=0; i< 3; i++)
    {
        printf("%d  ",new1[i]);
    }
}

Question Number 102

Give the output of the following code snippet :
void main()
{
    int i=0;
    do
    {
        i=i+3;
        printf("%d",i);
    }
    while(1);
}

Question Number 103

Which of the keywords denote the size and type of a variable in C :

Question Number 104

Which of the following statements is true about Strings in C :

Question Number 105

Which is the function used to copy a particular string into an array in C?

Question Number 106

Following is a challenge with Visual studio for a beginner,

Question Number 107

Which of the following are the user interfaces that help to debug a program with Visual Studio:

Question Number 108

Which of the following statements is true about the break statement in C:

Question Number 109

Give the output of the following code snippet :
int main()
{
    int i = 0;
    do
    {
        i++;
        printf("Ho ");
    }
    while (i <  3);
}

Question Number 110

Give the output of the following code snippet :

void func(int a)
{
    int sum=0,x;
    while(a!=0)
    {
        x=a%100;
        sum+=(x+x+x);
        a=a/10;
    }
    printf("%d ",sum);
}
int main()
{
    func(1000);
    func(2222);
}

Question Number 111

Give the output of the following C code:


void main()
{

    int a=10,b=2;
    int t1=mult(a,b);

    int t2=mult(3,30);

    printf("Sum = %d", t1+t2);


}

int mult(int a, int b)
{
    return a*b;

}

Question Number 112

Which of the following is not a debugger :

Question Number 113

Which of the following statements is true about the fclose() function?

Question Number 114

Visual Studio is NOT

Question Number 115

Give the output of the following code snippet :
struct Point
{
    int x;
    int y;
};

int main()
{
    struct Point p1 = {10, 20};
    struct Point p2 = p1;
    if (p1 == p2)
        printf("p1 and p2 are same ");
}

Question Number 116

Give the output of the following code :
int main()
{
    int i=1;
    if(!i)
        printf("Hello,");
    else
    {
        i=0;
        printf("Jello");
        main();
    }
    return 0;
}

Question Number 117

Give the output of the following code snippet :
struct p
{
    int k;
    char c;

};
int main()
{
    struct p x[5];
    x[0].k=10;
    x[0].c='B';
    printf("%d %c\n", x[1].k,x[1].c);
}

Question Number 118

Give the output of the following code snippet :
int func()
{
    int i=10;
    if(i!=0)
        return 10.50;
    else
        return 20.75;
}
int main()
{
    float a=func();
    printf("%.2f",a);

}

Question Number 119

Give the output of the following code snippet :
void main()
{
    int x = 3;
    x++;
    if (x < = 5)
    {
        printf("Hello ");
        main();
    }
}

Question Number 120

Give the output of the following code snippet :
struct p
{
    int k;
    char c;

};
int main()
{
    struct p x = {10,1};
    x.k=5;
    printf("%d %d\n", x.k,x.c);
}

Question Number 121

Which of the following is related to a Microsoft Development tool package?

Question Number 122

Give the output of the following code snippet :
void main()
{
    int i;
    for(i=0; i< =4; i++)
    {
        printf("%d",i);
        break;
        printf(" Test1");
    }
    printf(" Test2");
}

Question Number 123

Give the output of the following code snippet :
struct Point
{
    int x;
    int y;
};

int main()
{
    struct Point p1 = {10, 20};
    struct Point p2 = p1;
    printf("%d  %d", p2.x, p2.y);
    getchar();
}

Question Number 124

Which of the following is a storage specifier?

Question Number 125

What is the range of the values allowed for the data type int in C:

Question Number 126

Which of the following statements are true about recursion?

Question Number 127

Give the output of the following code snippet :
void main()
{
    char new1[6]="Welcome";
    printf (new1);
}

Question Number 128

Give the output of the following code snippet :
void main()
{
    int i=0;
    do
    {
        i=i+3;
        i++;
        printf("%d",i);
    }
    while();
}

Question Number 129

Give the output of the following code snippet :
struct student
{
    int id;
};
void main()
{
    struct student s[10];
    s.[0].id = 10;
    printf("%d", s.[0].id);
}

Question Number 130

Give the output of the following code snippet :
void func()
{
    int i=1;
    while(!i)
    {
        func();
    }
    printf("%d",i++);
}
void main()
{
    func();
}

Question Number 131

Give the output of the following code snippet :
void main()
{
    int x = 3;
    {
        x = 4;
        printf("%d ", x);
    }
    printf("%d", x);
}

Question Number 132

Visual studio supports

Question Number 133

Give the output of the following code snippet :
int func()
{
    return (double)5.0;
}
void main()
{

    printf("%d", func());
}

Question Number 134

Name the type of errors that occur due to a missing semi-colon(;) in a C program:

Question Number 135

Consider the given code snippet :

int main()
{
    int i = 0;
    while (i <  3)
        i++;
    printf("In while loop\n");
}

How many times is the value of 'i' checked in the condition i <  3?

Question Number 136

The conditional operator can be used to replace which condition statement in C?

Question Number 137

Which of the following parts of a function are required when calling a function:

Question Number 138

Which of the following is a valid structure initialization?

Question Number 139

Give the output of the following code snippet :
void func(int a,int b)
{
    int z=a > b?a=10:a=20*10;
    printf("%d ",z);
}
int main()
{
    func(100,250);
    func(30,20);
}

Question Number 140

Give the output of the following code snippet :
int main()
{
    void Fun();
    printf("1 ");
    Fun();
}
void Fun()
{
    printf("2 ");
}

Question Number 141

Which of the following statements is true about a file in C?

Question Number 142

Which function returns a non-zero value if the error indicator is set for file stream?

Question Number 143

Give the output of the following code snippet :
void main()
{
    int x=0,y=1,z=2;
    for(;;)
        printf("%d",x+y+z);
}

Question Number 144

Following is a challenge with Visual studio for a beginner,

Question Number 145

How many times is the initialization part of the for loop carried out?

Question Number 146

Give the output of the following code :
void main()
{
    int var = strcmp("Hello","World");
    printf("%d", var);
}

Question Number 147

Give the output of the following code snippet :
void main()
{
    int x=0,y=1,z=2;
    x+y-z>10?x=100:y=200;
    if(x==100||y==200)
        printf("%d",2^x);
    else
        printf("%d",2^y);
}

Question Number 148

Give the output of the following code snippet :
void func()
{
    int i=10;
    void func1()
    {
        int j=10;
        printf("%d",j);
    }
    func1();
    printf("%d",i);
}
int main()
{
    func();
}

Question Number 149

Which of the following is an example of looping in C?

Question Number 150

Which is the function key in VS is associated with passing the control to the function definition to debug it using breakpoint:

Question Number 151

Which of the following are the user interfaces that help to debug a program with Visual Studio:

Question Number 152

Versions of Visual Studio are,

Question Number 153

What is the general syntax to call a function in C?

Question Number 154

Boiler Plate code is auto-generated in Visual Studio by,

Question Number 155

Give the output of the following code snippet :
void main()
{
    int a=13;
    if(a==12)
    {
        a==12?a=0:a=1;
        if(a==0)
            a++;
        else
            a--;
    }
    else
        a-2;
    printf("%d",a);
}

Question Number 156

The last element of the array arr[10] is accessed by :

Question Number 157

Which of the following functions is used to rename a particular file?

Question Number 158

Visual Studio is NOT

Question Number 159

Give the output of the following code snippet :
int main()
{
    int a,b;
    int func(int,int);
    a=func(100,250);
    b=func(20,20);
    printf("%d %d",a,b);
}
int func(int a,int b)
{
    int z= a >= b?(a= a*b): (a=20/b) ;
    return z;
}

Question Number 160

How many elements does the array arr[25] contain?

Question Number 161

Which of the following statements are true about keywords in C?

Question Number 162

Give the output of the following code snippet :
int sub(int a, int b)
{

    if(a>b)
        return a-b;
    else
        return b-a;


}
int main()
{
    printf("%d", sub(10,20));
}

Question Number 163

Visual Studio is NOT

Question Number 164

Give the output of the following code snippet :
void main()
{

    int a;
    for(a=0; a< 5; a++)
    {
        if(a==2)
            break;
        printf("Hello world");
    }

}

Question Number 165

In C, a function can be called from :

Question Number 166

Which of the keywords denote the size and type of a variable in C :

Question Number 167

For a given C program, a function can be called :

Question Number 168

Give the output of the following code snippet :
int x;
void main()
{
    printf("%d", x);
}

Question Number 169

Give the output of the following code snippet :
void dummy() {};
void main()
{
    dummy();
}

Question Number 170

Give the output of the following code snippet :
void main()
{
    static int x;
    if (x++ <  2)
    {
        printf("Ho " );
        main();
    }
}

Question Number 171

Give the output of the following code snippet :
int main()
{
    int i=0;
    if(i--)
    {
        printf("%d",i++);
        main();
    }
    else
        printf("%d",--i);
}

Question Number 172

The main function in a given program cannot be called recursively. State true or false :

Question Number 173

The value obtained in the function is returned to main() by using which keyword?

Question Number 174

Given the following code snippet, find the output of the program :



void main()
{
    int a=5;

    switch(a)
    {
    case 5;
        printf("Value is 5");
        break;
    }
}

Question Number 175

Give the output of the following code snippet :
void main()
{
    int a=10;
    switch(a--)
    {
    case 10 :
        printf("%d ",a);
        break;
    case 10*10/10  :
        printf("%d ",a++);
    case 11:
        printf("%d",a--);
        break;
    default:
        printf("Hello");
        break;
    }
}

Question Number 176

Give the output of the following code snippet : Assume the contents of the file 'Test.txt' is "Hello World".
void main()
{
    char x;
    FILE *fp,*fp1;
    fp=fopen("Test.txt","a+");
    fseek(fp,10,SEEK_SET);
    fputc('S',fp);
    fclose(fp);
    fp1=fopen("Test.txt","r");
    while((x=getc(fp1))!=EOF)
    {
        printf("%c",x);
    }
    fclose(fp1);
}

Question Number 177

Which of the following is the default method to pass arguments in C?

Question Number 178

Wizard in Visual studio is normally a set of,

Question Number 179

Which of the following are file positioning functions in C?

Question Number 180

If two strings are identical, then what does the strcmp() function return?

Question Number 181

Give the output of the following code snippet :

int main()
{
    int i;
    int arr[3] = {0};
    for (i = 0; i < = 3; i++)
        printf("%d ", arr[i]);
    return 0;
}

Question Number 182

Which of the following modes is used to indicate line buffering of text files in the setvbuf() function?

Question Number 183

Give the output of the following code snippet :
struct test
{
    int k;
    char c;
    float f;
};
int main()
{
    struct test var = {5,80,2.0};
    printf("%f\n", var.f);
}

Question Number 184

What are the arguments that the fopen() function takes?

Question Number 185

Which of the following is used to represent comments in C:

Question Number 186

Give the output of the following code snippet :
struct student
{
    int no;
};
void main()
{
    struct student s;
    no=10;
    printf("%d",no);
}

Question Number 187

Show the correct order of execution for creating and executing a program in Visual Studio:

Question Number 188

Wizard in Visual studio is normally a set of,

Question Number 189

Give the output of the following code snippet :
struct point
{
    int x;
    int y;
};
struct point2
{
    int x;
    int y;
};
void fun(struct point);
int main()
{
    struct point2 p1 = {1, 2};
    fun(p1);
}
void fun(struct point p)
{
    printf("%d\n", p.x);
}

Question Number 190

Which of the following statements is true about a minimal function in C?

Question Number 191

Give the output of the following code :
void main()
{
    char str1[]= {0};
    printf(str1);
}

Question Number 192

In which header file is the integer expression errno declared?

Question Number 193

What is the green play button in the Visual studio does?

Question Number 194

Give the output of the following code snippet :
void main()
{
    int a=12,i=0;
    --a;
    while(++i)
    {
        printf("%d",a);
        ++i;
    }

}

Question Number 195

Give the output of the following code snippet :
void main()
{
    int i=3,x=10;
    i=i*x/i;
    switch(i)
    {
    case 2:
        printf("%d ",x++);
        break;
    case 3:
        printf("%d ",x+2);
        break;
    case 4:
        printf("%d ",x+3);
    default:
        printf("Hello");
        break;
    }
}

Question Number 196

Which of the following are the user interfaces that help to debug a program with Visual Studio :

Question Number 197

Following is a challenge with Visual studio for a beginner,

Question Number 198

Give the output of the following code snippet :
int main()
{
    int i=0;
    while(!i++)
    {
        printf("%d",i--+ ++i);
        main();
    }
}

Question Number 199

Which is NOT a Visual Studio edition.

Question Number 200

Give the output of the following code snippet :
void main()
{
    int x=0,y=1,z=2;
    if((x==y)&&(z==x+2))
        printf("%d",z);
    else
        printf("%d",++x);
}

Question Number 201

What is the return type of the getchar() function?

Question Number 202

Give the output of the following code snippet :
int func(int a,int b)
{
    int i=100;
    if(i++< =100)
        return 20;
    else
        return 30;
}
int main()
{
    int z=func(100,200);
    printf("%d  ",z);
    printf("%p",main);
}

Question Number 203

Give the output of the following code snippet :
void main()
{
    int x=0,y=0,z=2;
    x+y+z>0?x=10:y=20;
    if(x&&y)
        printf("%d",10*x);
    else
        printf("%d",20*y);
}

Question Number 204

Give the output of the following code snippet : Assume the input given in 100.
void main()
{
    int x=0,z;
    z=printf("%d ",scanf("%d ",x));
    printf("%d",z);
}

Question Number 205

Give the output of the following code snippet :
void main()
{
    char arr[11]="The African";
    printf("%s",arr);

}

Question Number 206

When a program begins execution, which of the following streams are open?

Question Number 207

Give the output of the following code snippet :
int main()
{
    for(int i=0; i< =4; i++)
    {
        printf("%d ",i);
    }

    return 0;
}

Question Number 208

Give the output of the following code snippet :
void main()
{
    struct temp
    {
        int a;
        char b;
        struct temp1
        {
            char c;
        } p;
    };
    struct temp t1 = {10,'A','e'};

    printf("%d %c %c ",a,b,c);
}

Question Number 209

Give the output of the following code snippet :
void main()
{
    int a=10;
    switch(a)
    {
    case 10 :
        printf("%d",a);
        continue;
    case a:
        printf("%d",a++);
        break;
        printf("%d",a);
    }
}

Question Number 210

Name the three main parts of a for loop in C :

Question Number 211

Give the output of the following code snippet :
struct p
{
    int k;
    char c;

};
int main()
{
    struct p x[5];
    x[0].k=10;
    x[0].c='a';
    printf("%d %d\n", x.k,x.c);
}

Question Number 212

Give the output of the following code snippet :
void func()
{
    int i=1;
    while(!i)
    {
        func();
        exit(0);
    }
    printf("%d",i++);
}
void main()
{
    func();
}

Question Number 213

Give the output of the following code snippet :
void main()
{
    int i=0;
    for(;; i++)
    {
        i=i+3;
        if(i==12)
            continue;
        else
            break;
    }
    printf("%d",i);
}

Question Number 214

Find the output of the code snippet :
void main()
{
    int arr[10]= {10,2.5,3,5.5};
    for(int i=0; i< 5; i++)
        printf("%d  ",arr[i]);
}

Question Number 215

Give the output of the following C code:
int mult(int a, int b)
{
    return a*b;

}

int sum ( int a, int b)
{
    return a+b;
}

void main()
{

    int a=10,b=2;
    int t1=mult(a,b);

    int t2=mult(3,30);

    printf("Sum = %d", sum(t1,t2));


}

Question Number 216

Which of the following statements is not true about the tmpfile() function?

Question Number 217

Give the output of the following code snippet :
void func(int a)
{
    int sum=0,x;
    while(a!=0)
    {
        x=a%10;
        sum+=(x*x);
        a=a/10;
    }
    printf("%d ",sum);
}
int main()
{
    func(100);
    func(200);
}

Question Number 218

Give the output of the following code :
void main()
{
    char new1[]= { 0 };
    strcpy(new1,"Jello");
    int n=strlen(Jello);
    printf("%d ",n);
}

Question Number 219

Give the output of the following code snippet :
int func2(int y)
{
    if(y==1)
        return 1;
    func2(--y);
}
void main()
{
    int i=10;
    int b=func2(i);
    printf("%d",b);
}

Question Number 220

What is the method used to pause an application at a particular point ?

Question Number 221

Which of the following modes is used to indicate full buffering in the setvbuf() function?

Question Number 222

Which of the following statements are used to alter the flow of control in a C program :

Question Number 223

Which function causes the buffered but unwritten data to be written to the file on an output stream C?

Question Number 224

The keyword 'break' cannot be used within :

Question Number 225

Give the output of the following code snippet :
void main()
{
    static double x;
    int x;
    printf("x is %d", x);
}

Question Number 226

Which of the following is true for static variable?

Question Number 227

Give the output of the following code snippet :

void main()

{
    printf("Before continue ");
    continue;
    printf("After continue\n");
}

Question Number 228

Which mode is used to denote opening the text file for update but discards any previous contents if any?

Question Number 229

A stream is connected to a file or device by :

Question Number 230

Which mode is used to denote opening the binary file for update where the writing is done at the end?

Question Number 231

Give the output of the following code snippet :
void main()
{
    int arr[10]= {5};
    printf("%d %d",arr[1],arr[9]);
}

Question Number 232

Which of the following is not a logical operator in C ?

Question Number 233

Which of the following is related to a Microsoft Development tool package.

Question Number 234

Give the output of the following code snippet :
void main()
{
    struct temp
    {
        int a;
        char b;
        struct temp1
        {
            char c;
        } p;
    };
    struct temp t1 = {10,'A','e'};

    printf("%d %c %c ",t1.a,t1.b,p.c);
}

Question Number 235

Visual Studio has

Question Number 236

Give the output of the following code snippet :
struct test
{
    int k;
    char c;
    float f;
};
int var=10;
int main()
{
    struct test var = {5,80};
    printf("%f\n", var.f);
}

Question Number 237

What are the two arguments that are passed to the strcpy function for string manipulation in C?

Question Number 238

Which of the following statements is true about Strings in C :

Question Number 239

Give the output of the following C code:
int mult(int a, int b);


void main()
{

    int a=10,b=2;
    int t1=mult(a,b);

    int t2=mult(3,30);

    printf("Sum = %d", t1+t2);


}

int mult(int a, int b)
{
    return a*b;

}

Question Number 240

Give the output of the following code snippet :

void main()
{
    Test();
}
void Test()
{
    printf("Hello");

}

Question Number 241

Give the output of the following code snippet :
struct student
{
    int id;
};
void main()
{
    struct student s[10];
    s.id[0] = 10;
    printf("%d", s.id[0]);
}

Question Number 242

Give the output of the following code snippet :
void test();
void main()
{
    test();
    test();
}
void test()
{
    static int x = 5;
    x++;
    printf("%d", x);
}

Question Number 243

Give the output of the following code snippet : Assume the contents of the file 'Test.txt' is "Hello World".
void main()
{
    FILE *fp,*fp1;
    char x[20];
    fp = fopen("Test.txt","r");
    int i=0;
    while(fgets(x,5,fp)!=NULL)
    {

    }
    puts(x);
    fclose(fp);

}

Question Number 244

Give the output of the following code snippet :
int main()
{
    struct emp
    {
        char name[25];
        int age;
    };
    struct emp e;
    e.name = "Jenna";
    e.age = 25;
    printf("%s %d\n", e.name, e.age);
    return 0;
}

Question Number 245

Give the output of the following code snippet :
struct p
{
    int mark1,mark2;
};

int main()
{
    struct p x = {50,50,50};
    printf("%d %d\n",x.mark1,x.mark2);
}

Question Number 246

Which of the keywords denote the scope of a variable in C :

Question Number 247

Versions of Visual Studio are,

Question Number 248

Which of the keywords denote the scope of a variable in C :

Question Number 249

Give the output of the following code snippet :

int main()
{
    int i = 0;
    do
    {
        i++;
        if (i == 2)
            continue;
        printf("In the loop ");
    }
    while (i <  2);
    printf("%d\n", i);
}

Question Number 250

Give the output of the following code snippet :
int main()
{
    do
        printf("In while loop ");
    while (0);
    printf("After loop\n");
}

Question Number 251

Which of the following statements is true about the EOF character in C?

Question Number 252

Name the looping statements available in C :

Question Number 253

Give the output of the following code snippet : Assume the contents of the file 'Test.txt' is "Hello World".
void main()
{
    char x;
    FILE *fp,*fp1;
    fp=fopen("Test.txt","w+");
    fputc('S',fp);
    fclose(fp);
    fp1=fopen("Test.txt","r");
    while((x=getc(fp1))!=EOF)
    {
        printf("%c",x);
    }
    fclose(fp1);
}

Question Number 254

What is the escape sequence used to denote a double quote in C?

Question Number 255

What does the fclose() function take as the argument?