Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
videid
/
iax0583
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
673ce6bd
authored
Dec 08, 2017
by
videid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hw2 1st
parent
44d03905
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
0 deletions
homework2/homework2.c
homework2/homework2.c
0 → 100644
View file @
673ce6bd
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
void
size
(
int
*
rows
,
int
*
columns
);
void
fill
(
int
rows
,
int
columns
);
int
main
(
void
){
int
rows
;
int
columns
;
size
(
&
rows
,
&
columns
);
fill
(
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
myArray
[
rows
][
columns
];
for
(
i
=
0
;
i
<
rows
;
i
++
){
for
(
j
=
0
;
j
<
columns
;
j
++
){
printf
(
"enter number
\n
"
);
scanf
(
"%d"
,
&
h
);
myArray
[
i
][
j
]
=
h
;
}
}
for
(
i
=
0
;
i
<
rows
;
i
++
){
for
(
j
=
0
;
j
<
columns
;
j
++
){
printf
(
"%d"
,
myArray
[
i
][
j
]);
}
printf
(
"
\n
"
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment