C++ Program statements using Functions
Here is a list of some programs which can be used as practice of C++ programming using functions
1. Write a program in which a functions return the sum, subtraction, multiplication and
division (depending on users choice) of 2 numbers taken from main.
2. Write a program that prints maximum number among 3 values taken from user.
3. Write a program to swap the values of two integers.
4. Write a function to check whether the year entered from user is leap or not.
5. Write a function that receives marks of 3 students and returns average and Percentage of numbers.
6. Write a program that reads five-digits integer and check whether it is a Palindrome.
enter 0 to exit program
Sample output:
Enter a five digit Number : 11611
11611 is a Palindrome
7. Write a program which check username and password and display Login information is
correct or Not. Show password in asterisks(*)
Sample output:
Enter user name: uog
Enter password: *****
Log in information is Correct !
8. Write a program in which function checks whether character passing from main is capital
or not, if it is capital show that alphabet else first make it capital then show it.
9. Write a program to calculate Area and perimeter of a circle.
10.Write a program to show sum of first n values where n is input from user.
11. An integer is entered through keyboard. Write a program to find prime factors of the number e.g prime factors of 35 are 5 and 7.
12. Write a program that takes 5-digit number from user where one function will
return its reverse and the sum of these digits will be calculated using another
function. e.g reverse of number 12345 is 54321 and sum of digits is 15.
14. Write a function that receives a string and at the end you have to show how
many capital letters, small letters, integers and symbols it contains. Program
should terminate on pressing esc key.
15. An integer is input through user. Write a program to show next prime number
of entered number.
C++ Program statements using Functions
0 comments:
Post a Comment