Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.
Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".
Start coding now!
Input
The first line contains the size of the array.
The next lines contain the integers.
The last line contains an integer to be searched.
5
3
21
2
5
23
2
Output
A line containing a string.
Present
by CodeChum Admin
Make me a program that accepts a size of the character array and its values. Then, count the number of uppercase vowels that are in it.
Easy, right? Then go and code as if your life depends on it!
Tip: After your scan for the size, add a space after the placeholder like this so that the newline character directly after the number won't be scanned as one of the characters:
scanf("%d ", &size);
Input
1. Size of the array
2. Characters of the array
Output
The first line will contain a message prompt to input the size of the array.
The second line will prompt to input the characters of the array.
The last line contains the count of the uppercase vowels.
Enter·the·size·of·the·array:·19
CodeChum·is·AWEsome
Count·=·2
by CodeChum Admin
Make a program that will accept an integer and loop for the same number of times as that of the inputted integer and input random integers and add it to the array/list one by one, per line. Afterwards, make your program accept another random integer.
Using that final integer, compare from your array/list if the final integer's value is also present in your current array/list. If so, print "Present"; otherwise, print "None".
Start coding now!
Input
1. Size of the array
2. Elements of the array
3. Integer to be searched
Output
The first line will contain a message prompt to input the size of the array.
The succeeding lines will contain message prompts to input the elements of the array.
The next line will contain a message prompt to input the integer to be searched.
The last line contains the appropriate message.
Enter·the·size:·5
Element·#1:·3
Element·#2:·21
Element·#3:·2
Element·#4:·5
Element·#5:·23
Enter·the·integer·to·be·searched:·2
Present
by CodeChum Admin
We've already made arraying/listing the easy way, but how about arraying/listing and printing the list in reverse order?
Make a program that will input an integer and then using loops, add items on an array/list one by one for the same number of times as that of the first inputted integer. Then, print out the array/list in reverse order, that is, starting from the last item on the array/list down to the first one, each in separated lines.
Input
1. Size of the array
2. Elements of the array
Output
The first line will contain a message prompt to input the size of the array.
The succeeding lines will contain message prompts to input the elements of the array.
The next lines will contain the elements of the array in reversed order.
Enter·the·size:·5
Element·#1:·1
Element·#2:·64
Element·#3:·32
Element·#4:·2
Element·#5:·11
Reversed·Order:
Element·#1:·11
Element·#2:·2
Element·#3:·32
Element·#4:·64
Element·#5:·1
by CodeChum Admin
We've already tried printing out the values of an array in reversed order, right? Today, we shall compute for the squares of all the numbers.
There's already a predefined array/list containing 100 integer values. Loop through each values, compute their squares, and display them.
Output
Multiple lines containing an integer.
4
9
25
10000
49
9
25
9
1
16
.
.
.
Make a c++ program that will print the average of the values of the three quizzes using function. The values of the quizzes are input values from the user.