0

i am new student i had a home work but i cant get this done
how can i input in the same line a char and two integers
the output should be like this :

please enter candidate family condition, defect percent,
children number, working condition: s 20 0 1

in my program i wrote it like this:

printf("please enter candidate family condition, defect percent,
children number, working condition: ");
scanf("%c,%d,%d,%d",&status,&defect,&chnum,&w_cond);

i dont get it right when i input this : s 20 0 1
i tried without space even,but the teacher told us we have to input the data in one line and spaces between them

i would be happy if anyoe could help me
thx

3
Contributors
3
Replies
4
Views
10 Years
Discussion Span
Last Post by MasterBlast
0

Also MasterBlast, use code tags to post your code since it makes the code easier to read as well as the formatting is maintained.

Read the forum announcements.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.