Skip to Main Content
Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
book

Xpress Learning - Computer Fundamentals of Programming an IT by Pearson

by Ashok N. Kamthane, Rohit Khurana
May 2024
Beginner to intermediate content levelBeginner to intermediate
465 pages
16h 14m
English
Pearson India
Content preview from Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
The C Declarations II-33
Find the bug/s in the following program/s.
Characters, integers, long, unsigned etc
1.
void main()
{
unsigned int d=65535;
unsigned char p=65;
clrscr();
printf("%c %c",d,p);
getche();
}
Bug: No Bug. However, first %c is to be replaced
by %u and then answer will be 65535 A
2.
void main()
{
char x=-127;
unsigned char p=-127;
clrscr();
printf("\n%d %d"x,p);
getche();
}
Bug: Missing, (comma) in printf(). Answer would be
-127 129
3.
void main()
{
int x=2,
printf("%d",x);
}
Bug:Statement terminated by comma. Answer after correction will be 2.
M02_ITL-ESL4791_02_SE_C02.indd 33 12/22/2012 4:59:43 PM
II-34 Programming Concepts
4.
void main()
{ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Express Learning - Computer Fundamentals and Programming

Express Learning - Computer Fundamentals and Programming

Ashok Kamthane, ITL ESL
Windows® Internals, Sixth Edition, Part 2

Windows® Internals, Sixth Edition, Part 2

David A. Solomon Mark E. Russinovich and Alex Ionescu

Publisher Resources

ISBN: 9781299954878