Posted by: techGuy December 15, 2008
Login in to Rate this Post:
0
?
LD...la maile lekhidiye hai, here is the pseudocode
a)
declare a two dimensional array int a[3][5];
for i =1 to 3
{
print Enter values for set i
for j =1 to 5
{
print Enter Value for a[i][j];
read value for a[i][j];
}
}
b) compute the average of each set of 5 values
int avg;
for i =1 to 3
{
int sum=0;
Print Average value for set i is
for j =1 to 5
{
sum=sum+a[i][j];
}
avg= sum/5;
print avg;
}
c) compute the avg of values
int sum=0;
int avg;
for i =1 to 3
{
for j =1 to 5
{
sum=sum+a[i][j];
}
}
avg=sum/15;
d) determine the largest of three values
int max=0;
for i=1 to 3
{
for j=1 to 5
{
if a[i][j]>max
{
max=a[i][j];
}
}
}
e)
display array
display avg of b
display avg of c
display max of d
a)
declare a two dimensional array int a[3][5];
for i =1 to 3
{
print Enter values for set i
for j =1 to 5
{
print Enter Value for a[i][j];
read value for a[i][j];
}
}
b) compute the average of each set of 5 values
int avg;
for i =1 to 3
{
int sum=0;
Print Average value for set i is
for j =1 to 5
{
sum=sum+a[i][j];
}
avg= sum/5;
print avg;
}
c) compute the avg of values
int sum=0;
int avg;
for i =1 to 3
{
for j =1 to 5
{
sum=sum+a[i][j];
}
}
avg=sum/15;
d) determine the largest of three values
int max=0;
for i=1 to 3
{
for j=1 to 5
{
if a[i][j]>max
{
max=a[i][j];
}
}
}
e)
display array
display avg of b
display avg of c
display max of d