MENU
Question -

Write a function RevText() to read a text file “Input.txt” and Print only word starting with ‘I’in reverse order. [Delhi, 2015]
Example : If value in text file is : INDIA IS MY COUNTRY v
Output will be : AIDNI SI MY COUNTRY



Answer -

void RevText ()
 {ifstream in ("Input.txt");
 char word[25];
 while(in)
 { in >>word;
 if (word[0] = = 'I' )
 cout<
 else
 cout<
 }

Comment(S)

Show all Coment

Leave a Comment

Free - Previous Years Question Papers
×