Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
237 views
in Functions by (30.4k points)
closed by

Consider the following code snippet 

char ch;

cout<<“Enter an alphabet”; cin>>ch;

cout<<toupper(ch);

What is the output of the above code? Give a sample output. If the above code is used in a computer that has no cctype file, how will you modify the code to get the same output?

1 Answer

+1 vote
by (30.5k points)
selected by
 
Best answer

It reads a character and convert it into uppercase.

Eg: 

Enter an alphabet: a 

The output is A. 

If a computer has no cctype header file the code is as follows.

char ch;

cout<<“Enter an alphabet”; cin>>ch;

if (ch>=97 && ch<<122)

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...