Advertisement
ada_byron

vectores1

Nov 8th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. typedef struct
  4. {
  5. char v2[10];
  6. }vfecha;
  7.  
  8. void main()
  9. {
  10. char frase[200]={"Esto es una frase."};
  11. float v1[20];
  12. vfecha vfechas[5]={"1/1/1945","7/7/1999","12/4/2000","16/10/1989","8/3/2012"};
  13. int i,j;
  14.  
  15. for(i=0;i<20;i++)
  16. {
  17.     v1[i]=1.0;
  18. }
  19.  
  20. printf("Valor de frase:\n");
  21. for(i=0;i<200;i++)
  22. {
  23.     printf("%c",frase[i]);
  24. }
  25. printf("\n\nValor de v1:\n");
  26. for(i=0;i<20;i++)
  27. {
  28.     if(i<19)
  29. {
  30. printf("%f, ",v1[i]);
  31. }
  32. else
  33. {
  34.     printf("%f",v1[i]);
  35. }
  36. }
  37. printf("\n\nValor de vfechas:\n");
  38. for(i=0;i<5;i++)
  39. {
  40.     for(j=0;j<10;j++)
  41.     {
  42.         printf("%c",vfechas[i].v2[j]);
  43.     }
  44.     if(i<4)
  45.     {
  46.         printf(", ");
  47.     }
  48. }
  49. printf("\n");
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement