#include <conio.h>
#include<iostream.h>
void main()
{
int i,j;
int n=4;
float s;
int a[n][n];
for(i=0;i<=n;i++)
for(j=0;j<=n;j++)
a[i][j]=rand()%6;
cout<<a[i][j]<<" ";
s=s+a[i][j];
}
cout<<endl;
cout<<s/(n*n);
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <conio.h>
#include<iostream.h>
void main()
{
int i,j;
int n=4;
float s;
int a[n][n];
for(i=0;i<=n;i++)
{
for(j=0;j<=n;j++)
{
a[i][j]=rand()%6;
cout<<a[i][j]<<" ";
s=s+a[i][j];
}
cout<<endl;
}
cout<<s/(n*n);
}