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
Strings and Standard Functions II-177
{
char ans[8];
int i;
clrscr();
for(i=1;i<=3;i++)
{
printf("\nWhat is the currency of India?");
scanf("%s",ans);
fflush(stdin);
if(stricmp(ans,"Rupees")==0)
{
printf("\nAnswer is Correct.");
exit(1);
}
else
if (i<3)
printf("\n Try Again !\n");
}
clrscr();
printf("\NCurrency of India is Rupees.");
}
OUTPUT:
What is the currency of India?Rupee
Try Again !
What is the currency of India?Ruppea
Try Again !
What is the currency of India?Rupees
Answer is Correct.
19. Use of functions such as strcmp, strcat, and strlen
void main()
{
char str1[20]="C is", str2[20]="easy language";
int x,y,z;
clrscr();
printf("\n Source String:-%s",str1);
printf("\n ...
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