Question
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i = 0;
int cx = 0;
char str[] = "Hello, welcome!";
while (str[i])
{
if (ispunct(str[i])) cx++;
i++;
}
printf ("%d\n", cx);
return 0;
}
a.
1
b.
2
c.
3
d.
4
Posted under Object Oriented Programming Using C++
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. What kind of locale does every program is having in C++?
View solution
Q. What will the monetary facet will do?
View solution
Q. Which header file is used with input and output operations of C in C++?
View solution
Q. Which will be used with physical devices to interact from C++ program?
View solution
Q. How many streams are automatically created when executing a program?
View solution
Q. How many indicators are available in c++?
View solution
Q. What is the benefit of c++ input and output over c input and output?
View solution
Q. To which type does the numeric limits are suitable?
View solution
Q. Where does the member should be defined if it is used in the program?
View solution
Q. What will the max function in the numeric limit will return for type float?
View solution
Q. Which header file is used for the numeric limits in C++?
View solution
Q. Pick out the incorrect static function member in numeric limits.
View solution
Q. With which does the trigonometric functions work with angles in c++?
View solution
Q. Which header file is required for manipulation of math functions in c++?
View solution
Q. How many macros are used by mathematical functions in the header file
View solution
Q. Which of the following mathematical function is overloaded in <complex>
View solution
Q. How many parameters are used in frexp function?
View solution
Q. Which of the following library is used to do vector arithmetic?
View solution
Q. Which header file is used to manipulate the vector algebra in c++?
View solution
Q. What type of reference should be used in vector arithmetic?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!
Software Engineering
Learn about the systematic approach to developing software with our Software...
Microprocessor
Understand the heart of your computer with our Microprocessor MCQs. Topics include...