#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
|
| int | main (int argc, char *argv[]) |
◆ main()
| int main |
( |
int | argc, |
|
|
char * | argv[] ) |
Definition at line 4 of file Ejemplo038.c.
5{
6 int r, c, i, j;
7 double *A;
8 do{
9 printf("Ingrese el numero de renglones: ");
10 scanf("%d", &r);
11 }while(r<1);
12 do{
13 printf("Ingrese el numero de columnas: ");
14 scanf("%d", &c);
15 }while(c<1);
16 A = (double*)malloc(r*c*sizeof(double));
17 if(A==NULL)
18 return 1;
19 for(i=0; i<r; i++)
20 for(j=0; j<c; j++)
21 {
22 printf("A[%d][%d] = ", i+1, j+1);
23
24
25 scanf("%lf", A+c*i+j);
26 }
27 for(i=0; i<r; i++)
28 {
29 for(j=0; j<c; j++)
30 printf("%.4lf\t", A[c*i+j]);
31 printf("\n");
32 }
33 free(A);
34 return 0;
35}