Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.36 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. char a[3][20];
  4. char noob[3][200];
  5.  
  6. int b; //IS IT FOR
  7. int d;
  8. int l;
  9. int e;
  10. void main(){  
  11.         for(b=0;b<3;b++){
  12.                 char c[20] = "";
  13.                 char x[200] = "";
  14.                
  15.                 printf("Enter Name:\n");
  16.                 gets(c);
  17.                
  18.                 printf("\nEnter Quantity:\n");
  19.                 gets(x);
  20.                
  21.                 for(d=0;d<20;d++){
  22.                         a[b][d] = c[d];
  23.                 }              
  24.                
  25.                 for(e=0;e<200;e++){
  26.                         noob[b][e] = x[e];
  27.                 }
  28.  
  29. }
  30.         printf("=================================================================\n");
  31.         for(b=0;b<3;b++){
  32.                 printf("%d                      ", b+1); // 1 2 3
  33.                
  34.                 for(d=0;d<strlen(a[b]);d++){
  35.                         printf("%c",a[b][d]); // name
  36.                 }
  37.                
  38.                 printf("                        ");
  39.                
  40.                 for(l=0;l<strlen(noob[b]);l++){
  41.                         printf("%c",noob[b][l]); //quantity
  42.                 }
  43.                 printf("\n");          
  44.                
  45.                         //----------------
  46.         }
  47.        
  48.         printf("=================================================================");
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement