Question
Question 1- Write a C program that declares an array alpha of 100 elements of the type double. Initialize the array so that the first
Question 1- Write a C program that declares an array alpha of 100 elements of the type double. Initialize the array so that the first 50 elements are equal to the square of the index variable and the last 50 elements are equal to three times the index value. Print the array so that 10 elements per line.
Sample run output:
0000.00 0001.00 0004.00 0009.00 0016.00 0025.00 0036.00 0049.00 0064.00 0081.00
0100.00 0121.00 0144.00 0169.00 0196.00 0225.00 0256.00 0289.00 0324.00 0361.00
0400.00 0441.00 0484.00 0529.00 0576.00 0625.00 0676.00 0729.00 0784.00 0841.00
0900.00 0961.00 1024.00 1089.00 1156.00 1225.00 1296.00 1369.00 1444.00 1521.00
1600.00 1681.00 1764.00 1849.00 1936.00 2025.00 2116.00 2209.00 2304.00 2401.00
0150.00 0153.00 0156.00 0159.00 0162.00 0165.00 0168.00 0171.00 0174.00 0177.00
0180.00 0183.00 0186.00 0189.00 0192.00 0195.00 0198.00 0201.00 0204.00 0207.00
0210.00 0213.00 0216.00 0219.00 0222.00 0225.00 0228.00 0231.00 0234.00 0237.00
0240.00 0243.00 0246.00 0249.00 0252.00 0255.00 0258.00 0261.00 0264.00 0267.00
0270.00 0273.00 0276.00 0279.00 0282.00 0285.00 0288.00 0291.00 0294.00 0297.00
----------------------------------------------------------------------
Question 2- Write a C program that declares an array beta of 10 elements of the type integer. Initialize the array so that elements with even index values will be assigned a random integer number between 1 and 100, inclusive. All other elements (i.e., which have odd index values) will be assigned the address value of their previous element in the array as a decimal form. Print all the array elements.
Sample run output:
49
1894318896
1
1894318904
59
1894318912
58
1894318920
7
1894318928
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started