scanf function return value:
void main()
{
int a;
int b;
int c;
printf("Enter three number: ");
int x=scanf("%d%d%d",&a,&b,&c);
printf("%d/n%d/n",a,x);
}
x is the scanf() function return value == the valid input number
if input 5 6 7 ; x is 3
if input 5 6 d ; x is 2
没有评论:
发表评论