Q.1.

stderr, stdin, stdout are FILE pointers

Q.2.

What will be the content of 'file.c' after executing the following program?

#include<stdio.h>

int main()
{
    FILE *fp*fp    fp1=fopen("file.c", "w");
    fp2=fopen("file.c", "w");
    fputc('A', fp1);
    fputc('B', fp2);
    fclose(fp1);
    fclose(fp2);
    return}
Q.3.

Point out the error in the program?

#include<stdio.h>
#include<stdlib.h>

int main()
{
    unsigned char;
    FILE *fp;
    fp=fopen("trial", "r");
    if(!fp)
    {
        printf("Unable to open file");
        exit(1);
    }
    fclose(fp);
    return
}
Q.4.

Which of the following statement is correct about the program?

#include<stdio.h>

int main()
{
    FILE *fp;
    char ch;
    int i=
    fp = fopen("myfile.c", "r");
    while((ch=getc(fp))!=EOF)
    {
        if(ch == '\n')
            i++;
    }
    fclose(fp);
    return
}
Q.5.

While calling the fprintf() function in the format string conversion specifier %s can be used to write a character string in capital letters.

Q.6.

A file written in text mode can be read back in binary mode.

Q.7.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    int k=
    printf("%d == 1 is" "%s\n", k, k==1?"TRUE":"FALSE");
    return
}
Q.8.

Point out the error in the program?

#include<stdio.h>

int main()
{
    char ch;
    int i;
    scanf("%c", &i);
    scanf("%d", &ch);
    printf("%c %d", ch, i);
    return
}
Q.9.

Which of the following statement is correct about the program?

#include<stdio.h>

int main()
{
    FILE *fp;
    char str[11], ch;
    int i=
    fp = fopen("INPUT.TXT", "r");
    while((ch=getc(fp))!=EOF)
    {
        if(ch == '\n' || ch == ' ')
        {
            str[i]='\0';
            strrev(str);
            printf("%s", str);
            i=
        }
        else
            str[i++]=ch;
    }
    fclose(fp);
    return
}
Q.10.

A text stream is an ordered sequence of characters composed into lines, each line consisting of zero or more characters plus a terminating new-line character.

Q.11.

What will be the output of the program ?

#include<stdio.h>

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

Will the following program work?

#include<stdio.h>

int main()
{
    int n=    printf("n=%*d\n", n, n);
    return}
Q.13.

What will be the output of the program ?

#include<stdio.h>
char *str = "char *str = %c%s%c; main(){ printf(str,str, 34);}";

int main()
{
    printf(str,str, 34);
    return}
Q.14.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    int a=
    printf("%1d\n", a);
    return
}
Q.15.

Point out the error in the program?

#include<stdio.h>

int main()
{
    FILE *fp;
    fp=fopen("trial", "r");
    fseek(fp, "20", SEEK_SET);
    fclose(fp);
    return}
Q.16.

Point out the correct statements about the program?

#include<stdio.h>

int main()
{
    FILE *fptr;
    char str[80];
    fptr = fopen("f1.dat", "w");
    if(fptr == NULL)
        printf("Cannot open file");
    else
    {
        while(strlen(gets(str))>
        {
            fputs(str, fptr);
            fputs("\n", fptr);
        }
        fclose(fptr);
    }
    return
}
Q.17.

Offset used in fseek() function call can be a negative number.

Q.18.

What will be the output of the program ?

#include<stdio.h>

int main()
{
    FILE *fp;
    unsigned char ch;
     /* file 'abc.c' contains "This is IndiaBIX " */
    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
}
Q.19.

Can we specify a variable filed width in a scanf() format string?

Q.20.

What does fp point to in the program ?

#include<stdio.h>

int main()
{
    FILE *fp;
    fp=fopen("trial", "r");
    return
}