answersLogoWhite

0


Best Answer

I dont know how to generate the nos. randomly.I think it should follow some logic.So the following prog is made upon the inputs given by a user.
#include
#include
void main()
{ int a[5][5],i,j,s;
printf("\nEnter elements of the 5X5 matrics:\n");
for(i=0;i<5;i++)
{ for(j=0;j<5;j++)
{ scanf("%d",&a[i][j]);
if(a[i][j]<0 a[i][j]>100)
{ printf("\nThe no. should be between 1 & 100\nEnter Again:");
scanf("%d",&a[i][j]);
}
}
}
printf("\nThe given matrix is:\n");
for(i=0;i<5;i++)
{ for(j=0;j<5;j++)
printf("%d",a[i][j]);
printtf("\n");
}
printf("\nThe sum of each row:");
for(i=0;i<5;i++)
{ for(j=0;j<5;j++)
s+=a[i][j];
printf("%d->%d\n",i+1,s);
}
getch();
}
Hope this would help you.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Create a 5 by 5 matrix. Each element is randomly generated between 0 and 100.Output the matrix one by one and Output the sum of each row?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is the difference between linked list and Ordinary list?

A list is an abstract data structure, usually defined as an ordered collection of data. A linked list refers to a specific implementation of a list in which each element in the list is connected (linked) to the next element.


What is the difference between rewire-able fuse and catridge fuse?

the rewireable can be dissembled and has some sort of chucks to hold a new element


What is a simple code that provides details about HTML elements?

An HTML element is everything from the start tag to the end tag.An HTML element starts with a start tag / opening tagAn HTML element ends with an end tag / closing tagThe element content is everything between the start and the end tagSome HTML elements have empty contentEmpty elements are closed in the start tagMost HTML elements can have attributesSample CodeHello World


What is the difference between the Div and Span tag?

A div is a block element. This means that if you use a div, unless you float objects next to it using CSS, the div will be alone on a line. A span is an inline element. This means that unless you use line breaks next to it or change it to a block element using CSS, the span will be on the same line as whatever is next or before to it in the code. For example: This is a &lt;div&gt;element&lt;/div&gt; text is above and below but not beside This is a &lt;span&gt;element&lt;/span&gt;, text is before and after on the same line.


What is the difference between parallel and cereal circuits?

in the series circuit elements are one behind the other ie +ve terminal of one element is connected to the -ve of other element of the circuit whenever in parallel circuits the elements are parallely connect ie all +ve terminal are connected at a point and all -ve terminals of the elements are connected at a point.

Related questions

Is it possible to delete the element randomly in queue?

No,it's not possible to delete the element randomly


If element number 109 is produced will it be a transition element explain?

Element 109 has been discovered and repeatedly generated. It has been named Meitnerium (Mt) and is part of the Cobalt series (which is in the transition metals).


What is the atomic number for roentigenium?

Interesting ... At first I thought, this element does not exist. But then I looked it up and to my amazement found out its an artificially generated element with the atomic number 111 :-)


Do you get to choose the 5th element coat on howrse?

No, the coat is chosen randomly and each one gives your horse different bonuses.


What is the heaviest element that can be made by normal processes inside a star?

In very massive stars, Iron is sometimes generated.


What is the difference between a parent element and a daughter element?

biology


What Difference between element and atom?

an atom is the smallest unit of an element, but an element is a pure substance


What element is generated by a catheter ablation?

Although very little electricity is given off by the catheter, the instrument does generate a large amount of heat.


Difference between and compound and an element?

a compound is more then one element


What is the pattern between the element calcium and the element gallium?

they are making it stronger


What structure element does the author employ that makes the mental state of the narrator seem broken and scattered?

Short paragraphs that move quickly and randomly from thought to thought. -apex :)


What structural element does the author employ that makes the mental state of the narrator seem broken and scattered?

Short paragraphs that move quickly and randomly from thought to thought. -apex :)