Input Output of Elements in Float Array

By | June 19, 2019

“Input Output of Elements in Float Array” is a C language program to declare a 10 element array of float / real numbers. This c language array program will input and output these elements.

Source code for float array input out put of elements in C

Source code for float array input out put of elements in C

Here is an image to show the sample run and output of the float array input output C language program.

Here is an image to show the sample run and output of the float array input output C language program.

Here is an image to show the sample run and output of the float array input output C language program.

Here is the source code of the program to input 10 float elements in array and output them on screen.

 

/*
Write a C Program 
to input ten numbers in array
of ten float ( real numbers ). 
Display all values from array
*/
#include<stdio.h>

int main()
{
   float floatArray[10];
   int i;
   //input in array using for loop
   for(i=0; i<10; i++)
      {
	   printf("Enter Element No:%d=",i+1);
       scanf("%f", &floatArray[i]);
      }
   // show array elements using for loop
    printf("The elements of array are:\n");
    for(i=0;i<10;i++)
      printf("%.2f\n", floatArray[i]);
   
   return 0;
}

Here is a link to a related array program: Input and output of 10 element integer ( whole numbers ) array.

Leave a Reply

Your email address will not be published. Required fields are marked *