Search:

Type: Posts; User: sachin.leo

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    4,487

    int n[40]={0},i,j,top; for(i=0; i

    int n[40]={0},i,j,top;
    for(i=0; i<40 && n[i]!=-1; i++)
    scanf("%d",&n[i]);
    top = i-1;
    for(i=0;i<=top;i++)
    {
    for(j=0;j<n[i];j++)
    printf("|");
    printf("\n");
    }
  2. Replies
    4
    Views
    5,265

    i guess buffer problem

    may be there is some buffer problem. try cleaning buffer using fflush(stdin);
    moreover you are just taking ans in 1 character but you are taking a string as an input, you are wasting resources dude....
Results 1 to 2 of 2