The document outlines a series of programming tasks for students in the Department of Computer Science at Infolink University College. It includes flowchart development for various algorithms and C++ programming assignments, such as checking even/odd numbers, finding the largest of three numbers, calculating years/months/days from a total number of days, and identifying palindromes and prime numbers. Additionally, it emphasizes the use of loops in certain tasks and requires specific outputs for each programming challenge.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
2 views4 pages
CPP Assignment
The document outlines a series of programming tasks for students in the Department of Computer Science at Infolink University College. It includes flowchart development for various algorithms and C++ programming assignments, such as checking even/odd numbers, finding the largest of three numbers, calculating years/months/days from a total number of days, and identifying palindromes and prime numbers. Additionally, it emphasizes the use of loops in certain tasks and requires specific outputs for each programming challenge.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4
INFOLINK UNIVERSITY COLLEGE
DEPARTMENT OF COMPUTER SCIENCE
Develop a flowchart for each of the following questions. 1 point each
1. Receive 3 numbers and display them in ascending order from smallest to largest 2. Find the average of two numbers given by the user. 3. Swap the contents of two variables using a third variable. 4. Swap the content of two variables without using a third variable. 5. Read 10 integers from the keyboard in the range 0 - 100, and count how many of them are larger than 50, and display this result. 6. Take an integer from the user and display the factorial of that number Write a C++ program for each of the following questions 1. Write a program to check whether the given number is even or odd (using ? : ternary operator ) (1 point) 2. Write a program which input three numbers and display the largest number using ternary operator. (1 point) 3. Write a program which accepts days as integer and display total number of years, months and days in it.(1.5 point) Output Enter no. of days: 796 Years: 2 Months: 2 Days: 6 4. Write a program that calculates a random number 1 through 100. The program then asks the user to guess the number. If the user guesses too high or too low then the program should output "too high" or "too low" accordingly. The program must let the user continue to guess until the user correctly guesses the number.(2 point) 5. A palindrome is a word, number, phrase, or other sequence of characters which reads the same backward as forward, such as madam, racecar, 9119, 81018, 101,…. Write a program to check whether a number is palindrome or not. (1.5 point) 6. A prime number is an integer greater than one and divisible only by itself and one. The first seven prime numbers are 2, 3, 5, 7, 11, 13, and 17. Write a program that displays all the prime numbers between 1 and 100. (0.5 point) 7. Write a C++ program that counts the number of digits in an integer number. For example; 23498 has five digits. (0.5 point) 8. Write a program to print the following using loop.(This question is invalid if loop is not used).(1 point each) a.