C++ using OBJECT ORIENTED PROGRAMMING - Topics

C++ Using OBJECT ORIENTED PROGRAMMING - Practice Problems

C++ Using OBJECT ORIENTED PROGRAMMING - Practice Problems

1. Write a C++ method to find the smallest number among three numbers.

2. Write a C++ method to compute the average of three numbers.

3. Write a C++ method to display the middle character of a string.

Explanation -

Note: a) If the length of the string is odd there will be two middle characters. b) If the length of the string is even there will be one middle character.

4. Write a C++ method to find all twin prime numbers less than 100.

5. Write a C++ method to count the number of digits in an integer with the value 2. The integer may be assumed to be non-negative.

6. Write a C++ method that accepts three integers and checks whether they are consecutive or not. Returns true or false.

7. Write a C++ method that checks whether all the characters in a given string are vowels (a,e,i,o,u) or not. Return true if each character in the string is a vowel, otherwise return false.

Expand Your Horizons with Our Free YouTube Courses

Our comprehensive YouTube courses cover a wide range of computer science and IT subjects. Each course is carefully crafted to provide you with a solid foundation and a deeper understanding of the topic. Explore our playlist of free courses and learn at your own pace. Stay ahead of the curve and boost your knowledge with our engaging video lectures.

Java Course

Learn Now

Data Structures Course

Learn Now

DBMS Course

Learn Now