We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
EXERCISES
ONE DIMENSIONAL ARRAY QUESTION
1)Write a program to input 8 numbers into an array and print the even numbers from it if any. 2) Write a program to input 8 numbers into an array and print the odd numbers from it if any. 3) Write a program to input 8 numbers into an array and count the number of positive, negative and zeroes. 4) Write a program to input 8 numbers into an array and count the frequency of even and odd numbers into it. 5)Write a program to input 8 numbers into an array and print the sum of even and odd numbers separately. 6)Write a program to input 8 numbers into an array and check if all are even numbers or not. 7)Write a program to input 8 numbers into an array and check if all are same numbers or not. 8)Write a program to input 8 numbers into an array and print the largest even and smallest odd number (if any) into the array. 9) Write a program to input 8 numbers into an array and print those numbers which are divisible by 5. 10) Write a program to input 8 numbers into an array and print those numbers whose last digit is 3. 11) Write a program to input 8 numbers into an array and check whether all numbers are 2-digit numbers or not. 12) Write a program to input 8 numbers into an array and print perfect numbers from it if any. 13) Write a program to input 8 numbers into an array and print largest number from it. 14) Write a program to input 8 numbers into an array and print second largest number from it.' 15) Write a program to input 8 numbers into an array and print the position of largest and second largest number from it. 16) Write a program to input 8 numbers into an array and print smallest number from it. 17) Write a program to input 8 numbers into an array and find the position of the largest and the smallest numbers. 18) Write a program to input 8 numbers into an array and print prime numbers from it if any. 19) Write a program to input 8 numbers Into an array and count the frequency of prime numbers into the array. 20) Write a program to input 8 numbers into an array and check if all are prime numbers or not. 21) Write a program to input 8 numbers into an array and print the largest and smallest prime number into the array. 22) Write a program to input 8 numbers into an array and print the position of prime numbers from it if any. 23) Write a program to input 8 numbers into an array and print those numbers whose last digit is prime digit. 24) Write a program to input 8 numbers into an array and print the sum of prime numbers from it if any. 25) Write a program to input 8 numbers into an array and find the average of prime numbers only. 26) Write a program to input 8 numbers into an array and check if all are prime numbers or not. 27) Write a program to input 8 numbers into an array and check whether they are into ascending order or not. 28) Write a program to input 8 numbers into an array and check whether they are into descending order or not. 29) Write a program to input 8 positive numbers into an array and print the square of each numbers. 30) Write a program to input 8 positive numbers into an array and print the square rood of each numbers. 31) Write a program to input 8 numbers into an array and check if all are Fibonacci numbers or not. 32) Write a program to input 8 numbers into an array and check if all are unique numbers or not. 33) Write a program to input 8 numbers into an array and interchange the largest number with the smallest number within the array and print the modified array. Assume that there is only one largest and smallest number present into the array. 34) Write a program to input 8 numbers into an array and print all the numbers which are at even position into array. 35) Write a program to input 8 numbers into an array and print all the numbers which are at prime position into array. 36) Write a program to input 8 numbers into an array and reverse the original array and print the modified array. 37) Write a program to input 8 numbers into an array and replace all prime numbers into it (if any) by O and print the modified array. 38) Write a program to input 8 numbers into an array and interchange the consecutive elements into it. That is, interchange a[0] with a[1]. A[2] with a[3], a[4] with a[5] so on. 39) Write a program to input 8 numbers into an array and find the frequency of the largest number. 40) Write a program to input 8 numbers into an array and input a position. Now delete the element at that position by shifting the rest of the numbers to the left and insert a O at the end. 41) Write a program to input 8 numbers into an array and input a number and a position. Now insert the number at that position by shifting the rest of the numbers to the right. The last element is therefore removed from the array. 42) Write a program to input 8 numbers into an array and store all the prime numbers into another array and display it. 43) Write a program to input 8 numbers into an array and store the square of each numbers into another array and display it. 44) Write a program to input 8 numbers into an array and store all even numbers into another array and display it. 45) Write a program to input 8 numbers into an array and store all unique numbers into another array And display it.
Instant Download (Ebook) Embracing Modern C++ Safely by Lakos, John, Romeo, Vittorio, Khlebnikov, Rostislav, Meredith, Alisdair ISBN 9780137380350, 0137380356 PDF All Chapters