Write a c program to read and print the element of 2 D array. Please correct. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write a c program to read and print the element of 2 D array. Please correct.

#include<stdio.h> #include<conio.h> input(int a,int n) { int i; for(i=0;i<n;i++) { scanf("%d", &a[i]); } } output(int a,int n) { int i; for(i=0;i<n;i++) { printf("%d ", a[i]); } } int main() { int a[1000],i,n; printf("Enter size of array: "); scanf("%d",&n); printf("Enter %d elements in the array : ", n); input(a,n); printf("\nElements in array are: "); output(a,n); return 0; }

26th Jun 2021, 8:37 AM
Nishant Mina
Nishant Mina - avatar
0 Answers