Computer Science, asked by khushbookoul28, 9 months ago

Write a program to get and print the array elements. Sample Input: 5 4 6 7 8 9 Sample Output: 4 6 7 8 9

Answers

Answered by Rahul9048
3

Answer:

#include <stdio.h>  

 

void  main()  

{  

   int arr[10];  

   int i;  

      printf("\n\nRead and Print elements of an array:\n");

      printf("-----------------------------------------\n");  

 

   printf("Input 10 elements in the array :\n");  

   for(i=0; i<10; i++)  

   {  

    printf("element - %d : ",i);

       scanf("%d", &arr[i]);  

   }  

 

   printf("\nElements in array are: ");  

   for(i=0; i<10; i++)  

   {  

       printf("%d  ", arr[i]);  

   }  

   printf("\n");  

}

Explanation:

hope u like this

Answered by sourasghotekar123
0

Answer:

explained below

Explanation:

#include <stdio.h>  

void  main()  

{  

  int arr[10];  

  int i;  

  printf("\n\nRead and Print elements of an array:\n");

  printf("------\n");  

  printf("Input 10 elements in the array :\n");  

  for(i=0; i<10; i++)  

 {  

       printf("element - %d : ",i);

       scanf("%d", &arr[i]);  

}  

    printf("\nElements in array are: ");  

    for(i=0; i<10; i++)  

  {  

    printf("%d  ", arr[i]);  

  }  

   printf("\n");  

}

Sample Input: 5 4 6 7 8 9

Sample Output: 4 6 7 8 9

#SPJ2

Similar questions