Discussion
scanf() or atoi() function can be used to convert a string like "436" in to integer.
Answer: A
Correct answer: Yes
Both work. atoi("436") converts the string directly, and sscanf(str, "%d", &n) does the same with error reporting. strtol is better than either, since it distinguishes a genuine 0 from a failed conversion.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development