code to print out entire array in c
for (int i = 0; i < length; i++)
{
printf("%d ", arr[i]);
} //Change "length" to size of your own array and rename "arr" to your own array name
code to print out entire array in c
for (int i = 0; i < length; i++)
{
printf("%d ", arr[i]);
} //Change "length" to size of your own array and rename "arr" to your own array name
Program to input and print array elements in c
/**
* C program to read and print elements in an array
*/
#include <stdio.h>
#define MAX_SIZE 1000 // Maximum array size
int main()
{
int arr[MAX_SIZE]; // Declare an array of MAX_SIZE
int i, N;
/* Input array size */
printf("Enter size of array: ");
scanf("%d", &N);
/* Input elements in array */
printf("Enter %d elements in the array : ", N);
for(i=0; i<N; i++)
{
scanf("%d", &arr[i]);
}
/*
* Print all elements of array
*/
printf("\nElements in array are: ");
for(i=0; i<N; i++)
{
printf("%d, ", arr[i]);
}
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us