6. 

What will be the output of the program ?

#include<stdio.h>

int main()
{
    printf("%c\n", ~('C'*-1));
    return 0;
}

A. A
B. B
C. C
D. D

7. 

What will be the output of the program ?

#include<stdio.h>

int main()
{
    FILE *fp;
    unsigned char ch;
     /* file 'abc.c' contains "This is IndiaMax " */
    fp=fopen("abc.c", "r");
    if(fp == NULL)
    {
        printf("Unable to open file");
        exit(1);
    }
    while((ch=getc(fp)) != EOF)
        printf("%c", ch);

    fclose(fp);
    printf("\n", ch);
    return 0;
}

A. This is IndiaMax
B. This is
C. Infinite loop
D. Error

8. 

What will be the output of the program ?

#include<stdio.h>

int main()
{
    char *p;
    p="%d\n";
    p++;
    p++;
    printf(p-2, 23);
    return 0;
}

A. 21
B. 23
C. Error
D. No output

9. 

What will be the output of the program ?

#include<stdio.h>

int main()
{
    FILE *ptr;
    char i;
    ptr = fopen("myfile.c", "r");
    while((i=fgetc(ptr))!=NULL)
        printf("%c", i);
    return 0;
}

A. Print the contents of file "myfile.c"
B. Print the contents of file "myfile.c" upto NULL character
C. Infinite loop
D. Error in program

10. 

What will be the output of the program ?

#include<stdio.h>

int main()
{
    printf("%%%%\n");
    return 0;
}

A. %%%%%
B. %%
C. No output
D. Error