Documente Academic
Documente Profesional
Documente Cultură
Using a do-while loop, display all the values from array square on the screen.
SAMPLE OUTPUT
Please enter the number of array: 5
= RESULT =
3 to the power of 2 is 9
6 to the power of 2 is 36
2 to the power of 2 is 4
9 to the power of 2 is 81
7 to the power of 2 is 49
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
int size,x,y;
for (x =0;x<size;x++)
{
printf("Enter an integer number: ");
scanf("%d",&array[x]);
for (y = 0;y<size;y++)
{
printf("%d to the power of 2 is %2.2f \n ",array[y],pow(array[y],2));
return 0;
}