Results 1 to 2 of 2

Thread: 'Scanf' numbers into array...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Posts
    484

    'Scanf' numbers into array...

    Hi,

    Is it possible to use scanf to input numbers from the keyboard and store them in a array? I know it's possible with character strings.

    thnx

  2. #2
    Hyperactive Member
    Join Date
    Sep 2001
    Posts
    396
    int a[10], cnt;

    for (cnt=0;cnt<10;++cnt)
    {

    printf("\nEnter number %d :",cnt+1);
    scanf("%d", &a[cnt]);
    }
    I'm a VB6 beginner.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width