Professional Documents
Culture Documents
Ass 1
Ass 1
Ass 1
1. page use one one side lines and one side blanks
2. every next program start at new page.
3. compulsory the write output every program
DS
1.WAP and algorithm to demonstrate of array.
2.WAP and algorithm to perform the function of stack (1. Push 2. POP 3. Traverse Element)
3.WAP and algorithm to perform the function of queue (1. Rear 2. Front 3. Traverse
Element)
4. WAP and algorithm to perform the function of Cqueue (1. Insert 2. Delete 3. Traverse
Element)
C++
1. Write a program in C++ to print the sum of two numbers.
Sample Output:
4. Write a program in C++ to compute the total and average of four numbers.
Sample Output:
Sample Output:
Check whether a number is positive, negative or zero :
-----------------------------------------------------------
Input a number : 8
The entered number is positive.
9. Write a C++ program to check whether a given year is a leap year or not.
Is Leap year: 1900? Century of the year: 0
Is Leap year: 1999? Century of the year: 0
Is Leap year: 2000? Century of the year: 1
Is Leap year: 2010? Century of the year: 0
Is Leap year: 2020? Century of the year: 1
10. Write a C++ program to count the number of days between two given dates.
Date Format -> YYYY-MM-DD
Days between 2022/01/31 to 2022/01/01 = 30
Days between 2000/01/31 to 2019/02/01 = 6938
Days between 1980/05/31 to 1995/12/12 = 5677
13. Write a C++ program to find the largest word in a given string.
Example:
Sample Input: C++ is a general-purpose programming language.
Sample Output: programming
14. Write a C++ program to count all the vowels in a given string.
Example:
Sample Input: eagerer
Sample output: number of vowels -> 4
15. Write a C++ program to convert a given non-negative integer into English words.
Example:
Sample Input: 12
Sample Output: Twelve
Sample Input: 29
Sample Output: Twenty Nine
16. Write a C++ program to find the largest element of a given array of integers.
17. Write a C++ program to find the largest three elements in an array.
18. Write a C++ program to find the second largest element in an array of integers.
19. Write a C++ program to dynamically allocate an array of integers and strings and
initialize its elements.
20: WAP to draw a circle with radius of 80 pixels.
21: WAP to draw a circle with radius of 80 pixels on the center of screen.
o View Balance
o Withdraw Amount
o Deposit Amount
26.WAP to enter 5 student details just like name of student and UID Number and
Mobile Num and Total Marks.