write a C++ program.An array my_Array[] consisting of ‘a’ s, ‘b’ s and ‘c’s. The task is to write a function that
arranges the array such that all ‘a’s are placed first, then all ‘b’s and then all ‘c’s in last.
You are given two sorted arrays (all elements are in ascending order). You need to merge these
two arrays such that the initial numbers (after complete sorting) are in the first array and the
remaining numbers are in the second array.
Write a C++ program.
Dynamically allocate a 1D integer array of size n. Populate it with random numbers from 1 to
99.
Display the array in main function. Pass it to a void function difference() along with a variable
‘diff’ by reference.
The function displays the highest and the lowest element in the array and calculates the
difference between the highest and the lowest element and return it to the main function using
the variable passed where it is displayed.
You are given two sorted arrays (all elements are in ascending order). You need to merge these
two arrays such that the initial numbers (after complete sorting) are in the first array and the
remaining numbers are in the second array.
An array my_Array[] consisting of ‘a’ s, ‘b’ s and ‘c’s. The task is to write a function that arranges the array such that all ‘a’s are placed first, then all ‘b’s and then all ‘c’s in last.
Miss Nosheen is a kindergarten teacher and is teaching numbers to her pupils. She wants to allow her students to be able to immediately verify the results of their answers to the problem of finding out the digits in a number. Write a program which can take a number and show the number of digits it contains.
Jazmin encountered a problem in his mathematics class. His teacher announced that if any positive integer is equal to the sum of its proper positive divisors, i.e., the sum of its positive divisors excluding the number itself, such a number is called a perfect number. He told them to write fifty examples for such numbers. Ali understands that to find fifty examples will waste a lot of time, instead he will have to come up with a more efficient way to implement this. Help Ali implement such a system through your program.
Zyan wants to allow visitors of his new website to input and send the bid amounts of antiques shown. He likes to not let them send him any amount less than the base amount he set of Rs.5000. He thinks that the user should have to write the amount again until they write the right amount. Help Adeel setup such a system.
Jonathan is competing to be the class CR on a voting basis. Write a program to help count the number of positive and negative votes he received. The program should terminate if a student enters 0 instead of n or p.
Sample:
Enter your choice(p/n): p
Enter your choice(p/n): p
Enter your choice(p/n): n
Enter your choice(p/n): n
Enter your choice(p/n): p
Enter your choice(p/n): 0
The positive votes are: 3
The negative votes are: 2
Write a program to print the names of students by creating a Student class. If no name is passed while creating an object of Student class, then the name should be "Unknown", otherwise the name should be equal to the String value passed while creating object of Student class.