Write a C program that defines a 2-dimentional integer array
called A [50][50]. Then the elements of this array should
randomly be initialized either to 1 or 0. The program should
then print out all the elements in the diagonal (i.e.
a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally,
print out how many zeros and ones in the diagonal.
Answer Posted / pushpender singh
#include<stdio.h>
main
{
int a,b,c;
a[50][50];
b[][];
for(c=0;c>50;c+a)
{
a=a+c;
b=a;
}
printf("%d",b[][]);
}
}
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Explain what are multidimensional arrays?
Is there any demerits of using pointer?
What is the meaning of typedef struct in c?
What is data types?
how logic is used
What does s c mean on snapchat?
What is #line in c?
What is quick sort in c?
What are register variables in c?
How to implement a packet in C
Describe the difference between = and == symbols in c programming?
Explain the array representation of a binary tree in C.
What is meant by type specifiers?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
Where in memory are my variables stored?