C Programming Problems

Source: Internet
Author: User
C Programming Problems-general Linux technology-Linux programming and kernel information. The following is a detailed description. While (1)
{
Printf ("please input a student: Y/N \ n ");
Scanf ("% c", & s );
If (s = 'n' | s = 'n ')
Break;
Printf ("please your name :");
Scanf ("% s", name );
Strcpy (stu . Name, name );
Printf ("please your age ;");
Scanf ("% d", & stu. Age );
Printf ("please your sex :");
Scanf ("% d", & stu. Sex );
I ++;
}
Other codes are not included, but the whole program can run normally. The first cycle is normal, but it does not seem to be judged by s = n after the second time, and the input name is directly added, the break cannot exit normally. If you change the sex type to char, it does not seem to have the scanf input of sex.
This program uses the complete manual of "Detailed description of c program development in inux System ,,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.