5. Write c++ function that would intake a string and return
the number of occurrences of a given character in that sring
Ex:- if the word is “Colombo” and count the occurrences of
the letter “o” the function would return 3
Answer / qliubrvq
occurrences(string str, char test) {
int len = str.size();
int count = 0;
for (int i = 0; i < len; i++) {
if (str[i] == test) count++;
}
return count;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the symptoms of stl?
HOW TO GET "H1B" -VISA 4 USA FOR MY SON?HE HAD COMPLETED "MS"(IT)FROM AUSTALIA 2007.I AM WORKING IN U.S.A.
write a c++ to define a class box with length,breadth and height as data member and input value(),printvalue() and volume() as member functions.
write a program to convert a decimal number in to its equivalent binary number?
Which data structure gives efficient search? A. B-tree B. binary tree C. array D. linked list
21 Answers ABC, Sun Microsystems,
Explain stl.
Diffrernce Between Overloading and Overriding?
sir please send me bpcl previous question papers
0 Answers BPCL Bharat Petroleum,
what's the difference between function overloading and function overiding?
Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.
0 Answers GE, Infosys, Microsoft, NIM,
what is strcture i++ i ++i answer to this i=5 what is the out put
Do you like to Submit Questions in Bulk under Same Category?? Then use our Bulk ListerDo you like to Submit Questions in Bulk under Same Category?? Then use our Bulk Lister