Tuesday, 25 March 2014

Introduction to Programming Problem Statements - 1 for C++

Solve the following questions in c plus plus programming language for the following programming problems.

#1. Find out if a number is even or odd. 

Input
Number : 5

Output
Odd

#2. Input two numbers from a user and display the larger out of the two.

Input
Enter Number1 : 5
Enter Number2 : 3

Output
5 is greater than 3

[Note: Try to solve the same problem for three and four numbers.]

#3. Display the name of the day in week, depending upon the input entered.

Input
Enter the Day of Week : 3

Output
Tuesday

[Note: Write two programs, one problem will use switch case and other using if else construct.]

#4. Find and display the number of vowels, consonants and digits in a string (char array). 

Input
Enter the String : Hello World 123

Output
Vowels : 3 
Consonants : 7
Digits   : 3

[Hint : Use Switch Case]



Get Ebooks delivered to your email id

Comments

Subscribe to our channel

Facebook

Powered by Blogger.

Home | Contact Us | DMCA | Terms of Service | Privacy | Advertise

Maven Scientists