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
How can you check to see whether a symbol is defined?
What is malloc() function?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What do you understand by friend-functions? How are they used?
How can I get the current date or time of day in a c program?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is the process to create increment and decrement stamen in c?
Is the exit() function same as the return statement? Explain.
Whats s or c mean?
Why isn't any of this standardized in c? Any real program has to do some of these things.
Explain what is the difference between the expression '++a' and 'a++'?
What does a pointer variable always consist of?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What are formal parameters?
What are structure members?