Hola hic un programa me corre bien y todo, pero aun me da 3 warnings no c cual sea el problema, si me pueden ayudar, utilzo codeblocks. salu2.
#include <stdio.h>
#include <string.h>
#define N 2
#define T 30
int i,j;
typedef struct
{
char n[T];
char a[T];
}rnom;
typedef struct
{
rnom na;
int tel;
int cm;
float sal[T];
}registro;
registro reg[N];
void llenar(registro reg[])
{
for(i=0;i<N;i++)
{
printf("Nombres: ");
scanf(" %[^\n]",reg[i].na.n);
printf("Apellidos: ");
scanf(" %[^\n]",reg[i].na.a);
printf("Telefono: ");
scanf("%d",®[i].tel);
printf("Cantidad de meses a pagar: ");
scanf(" %d",®[i].cm);
for(j=0;j<(reg[i].cm);j++)
{
printf("Saldo: ");
scanf(" %f",®[i].sal[j]);
}
}
}
int suma1(int y,registro reg[])
{
int ss1=0;
for(j=0;j<reg[y].cm;j++)
ss1+=reg[y].sal[j];
return(ss1);
}
void imp1(registro reg[],int x,int y)
{
printf("\n Nombre: %s",reg[i].na.n);
printf("\nApellido: %s",reg[i].na.a);
printf("\ntotal: %d",x);
}
int suma2(registro reg[])
{
int ss2=0;
for(i=0;i<N;i++)
{
for(j=0;j<reg[i].cm;j++)
ss2+=reg[i].sal[j];
}
return(ss2);
}
void imp2(int x)
{
printf("\nEl saldo total de todos los acreedores es= %d",x);
}
void correr(reg)
{
int a=0;
for(i=0;i<N;i++)
{
a=suma1(i,reg);
imp1(reg,a,i);
}
a=suma2(reg);
imp2(a);
}
main()
{
llenar(reg);
correr(reg);
}
|