Re: problem with scanf( )
From: Al Bowers (xabowers_at_rapidsys.com)
Date: 11/28/04
- Next message: Old Wolf: "Re: Correct type for array indices"
- Previous message: Richard Tobin: "Re: Unix C programming for finding file"
- In reply to: sreelal: "problem with scanf( )"
- Next in thread: sreelal: "Re: problem with scanf( )"
- Reply: sreelal: "Re: problem with scanf( )"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 27 Nov 2004 21:38:14 -0500
sreelal wrote:
> Dear all,
>
> plz see the following prograam.
There are a few problems.
>
#include <stdio.h>
> main()
int main(void)
>
> {
> int a,b;
>
> scanf("%d %d ",&a,&b);
scanf("%d %d", &a,&b);
will do.
>
> printf("%d %d",a,b);
printf("%d %d\n",a,b);
return 0;
> }
>
>
> when i run the above program on windows using Turbo C,
> the program reads three numbers, ( it is expected to read two numbers only)
Enter the numbers, seperated by a space, ie.
34 23
-- Al Bowers Tampa, Fl USA mailto: xabowers@myrapidsys.com (remove the x to send email) http://www.geocities.com/abowers822/
- Next message: Old Wolf: "Re: Correct type for array indices"
- Previous message: Richard Tobin: "Re: Unix C programming for finding file"
- In reply to: sreelal: "problem with scanf( )"
- Next in thread: sreelal: "Re: problem with scanf( )"
- Reply: sreelal: "Re: problem with scanf( )"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|