google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a c program to read and display the elements of 2d array - 2nd puc computer science

Write a c program to read and display the elements of 2d array

Write a c program to read and print elements of array,Write a c program to read and print an array,Write a program to read and print elements of 2d array, write a program to read and display the elements of 2d array in c

Write a c program to read and display the elements of 2d array

#include<stdio.h>

#include<conio.h>

void main()

{

int a[10][10],i,r,c,j;

clrscr();

printf("Enter the order of matrix: ");

scanf("%d%d",&r,&c);

printf("Enter the elements\n");

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

         for(j=0;j<c;j++)

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

printf("Matrix is\n");

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

{

                  for(j=0;j<c;j++)

                           printf("%d",a[i][j]);

                           printf("\n");

         }

getch();

}

Output:

Enter the order of matrix: 3

3                                                                              

Enter the elements                                                             

1                                                                               

2                                                                              

3                                                                              

4                                                                              

5                                                                               

6                                                                              

7                                                                              

8                                                                               

9                                                                              

Matrix is                                                                      

123                                                                            

456                                                                            

789  
Write a c program to read and display the elements of 2d array Write a c program to read and display the elements of 2d array Reviewed by Vision Academy on December 12, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.