Commit a1de719d by videid

k

parent a299f310
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void size(int* rows,int* columns);
void fill(int *rows,int *columns );
//void disp(int rows,int columns,int myArray[rows+columns]);
int main(void){
int rows ;
int columns ;
size(&rows,&columns);
fill(&rows,&columns);
// disp(rows,columns,&myArray[rows+columns]);
return 0 ;
}
void size(int *rows,int *columns){
*rows = 0;
*columns =0 ;
while(*rows<= 0) {
printf("enter number of rows\n");
scanf("%d", rows);
}
while(*columns <= 0) {
printf("enter number of columns\n");
scanf("%d", columns);
}
printf("%d rows %d columns \n",*rows,*columns);
}
void fill(int *rows,int *columns){
int h;
int i;
int j;
int a = *rows;
int b = *columns;
int myArray[a*b];
for (i=1 ;i<= a*b ;i=i+b){
for(j=1;j<=b;j++){
printf("enter number \n");
scanf("%d", &h);
myArray[i+j] = h;
}
}
for (i=1 ;i<= a*b ;i=i+b){
for(j=1;j<=b;j++){
printf("%d",myArray[i+j]);
}
printf("\n");
}
}
//void disp(int rows,int columns,int myArray[rows+columns]){
//
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment