Questions

Q:

Point out the error, if any, in the following program.

# include "stdio.h"

main()

{

     FILE *fp;

     char str[80];

     fp = fopen ("trail", "r");

     while (!feof (fp))

    {

           fgets (str, 80, fp);

           puts (str);

     }

     fclose (fp);

}

Answer

The last line from the file "trial" would be read twice. To avoid this, ues:


       While ( fgets (str, 80, fp) ! = NULL)


               puts (str);

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

0 3218
Q:

1993 Nobel prize for literature has gone to the first black american lady, for her work ' Beloved'. The name of the lady is

A) Carla Hill B) Robin raphel
C) Winnie D) Toni morrison
 
Answer & Explanation Answer: D) Toni morrison

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Honours and Awards

2 3218
Q:

Who among the following is a famous American thriller and mystery fiction writer?

A) Dan Brown B) Rupert Brooke
C) John Brown D) Charlotte Bronte
 
Answer & Explanation Answer: A) Dan Brown

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Personalities

1 3217
Q:

Golden Temple of Amritsar is located in which country?

A) Bangladesh B) Pakistan
C) China D) India
 
Answer & Explanation Answer: D) India

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Places

3 3217
Q:

Kohinoor diamond was produced from one of the mines in

A) Golconda B) Bijapur
C) Odisha D) Chotanagpur
 
Answer & Explanation Answer: A) Golconda

Explanation:

Kohinoor diamond was produced from one of the mines in Golconda.

Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

1 3217
Q:

Titanwala Museum is located in which state?

A) Rajasthan B) Uttar Pradesh
C) Gujarat D) Tamil Nadu
 
Answer & Explanation Answer: A) Rajasthan

Explanation:

Titanwala Museum is located in India in Rajastan state.

Report Error

View Answer Report Error Discuss

Filed Under: Indian Geography
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

2 3217
Q:

Unlike conservation, what does preservation emphasize?

A) Saving natural resources B) Managing natural resoucres
C) Carrying capacity D) Renewing natural resources
 
Answer & Explanation Answer: A) Saving natural resources

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Science
Exam Prep: AIEEE , Bank Exams , CAT , GATE
Job Role: Analyst , Bank Clerk , Bank PO

1 3217
Q:

The most populous city in the world is  ?

A) Tokyo B) Paris
C) Peking D) London
 
Answer & Explanation Answer: A) Tokyo

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Famous Places
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

5 3216