InidBIX.com
Arithmetic Aptitude Data Interpretation
Logical Reasoning Verbal Reasoning
Sudoku Number puzzles Missing letters puzzles Logical puzzles Playing cards puzzles Clock puzzles
C Programming Java Programming
Data Structures Operating Systems Networking DATABASE Database Basics SQL Server Basics SQL Server Advanced SQL Server 2008 JAVA Core Java Java Basics Advanced Java UNIX Unix File Management Unix Memory Management Unix Process Managemnt
Aptitude Test Verbal Ability Test Verbal Reasoning Test Logical Reasoning Test C Programming Test Java Programming Test
Group Disucssion HR Interview Questions Technical Interview Questions Body Language

Exercise

"Success has many fathers, while failure is an orphan."
- (Proverb)

C Programming - Input / Output

@ : Home > C Programming > Input / Output > General Questions
1. 

What does fp point to in the program ?

#include<stdio.h>

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

A. The first character in the file
B.
A structure which contains a char pointer which points to the first character of a file.
C. The name of the file.
D. The last character in the file.

2. 

In a file contains the line "I am a boy\r\n" then on reading this line into the array str using fgets(). what will str contain?

A. "I am a boy\r\n\0"B. "I am a boy\r\0"
C.
"I am a boy\n\0"
D. "I am a boy"

3. 

To print out a and b given below, which of the following printf() statement will you use?

#include<stdio.h>

float a=3.14;
double b=3.14;

A.
printf("%f %lf", a, b);
B. printf("%Lf %f", a, b);
C. printf("%Lf %Lf", a, b);
D. printf("%f %Lf", a, b);

4. 

To scan a and b given below, which of the following scanf() statement will you use?

#include<stdio.h>

float a;
double b;

A. scanf("%f %f", &a, &b);B. scanf("%Lf %Lf", &a, &b);
C. scanf("%f %Lf", &a, &b);D.
scanf("%f %lf", &a, &b);

5. 

Out of fgets() and gets() which function is safe to use?

A. gets()B.
fgets()



© 2008-2010 by IndiaBIX™ Technologies. All Rights Reserved | Copyright | Terms of Use & Privacy Policy