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
What is a null pointer in c?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
In a switch statement, what will happen if a break statement is omitted?
What is the use of pragma in embedded c?
How can you allocate arrays or structures bigger than 64K?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
How is a structure member accessed?
Explain how can I avoid the abort, retry, fail messages?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
what is different between auto and local static? why should we use local static?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Explain what is a const pointer?
Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record
What is pragma in c?