SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
Let us c(by yashwant kanetkar)
chapter 4 solution 5th
edition
Exercise:-
[A]
(a).
Heart
I thought one wears a suite
(b).
I am in case 3
(c).
Pure Simple Egghead!
(d).
Customers are dicey
Markets are pricey
Investers are moody
At least employees are good
(e).
Trapped
(f).
You entered a and b
(g).
Feeding fish
Weeding grass
mending roof
Just to servive
[B]
(a).
After switch semicolon ( ' ; ' ) is written which is wrong
incorrect statement:-switch(suite);
correct statement:-switch(suite)
(b).
In the case statement we never used the expression o
we only write the integer in the case statement.
(c).
We can not write floating value inside the switch and case statement we can only
write integer value.
(d).
We only write the integer value in the case statement not the expression of integer
constant or the expression of integer variable.
[D]
/*To find grace marks using switch*/
#include<stdio.h>
void main()
{
int sub,cls;
printf("Enter the no. of subjects in which a student has failedn");
scanf("%d",&sub);
printf("enter the class through which the student has passed(write 1 instead of
1st div.,write 2 instead of 2nd div.,write 3 instead of 3rd
div.n");
scanf("%d",&cls);
switch(cls)
{
case 1:
switch(sub)
{
case 1:
printf("grace marks=5n");
break;
case 2:
printf("grace marks=10n");
break;
case 3:
printf("grace marks=15n");
break;
default:
printf("No grace marksn");
}
break;
case 2:
switch(sub)
{
case 1:
printf("grace marks=4n");
break;
case 2:
printf("grace marks=8n");
break;
default:
printf("no grace marksn");
}
break;
case 3:
switch(sub)
{
case 1:
printf("grace marks=5n");
break;
default:
printf("No grace marksn");
}
}
}
THANKS.............

Weitere ähnliche Inhalte

Was ist angesagt?

structure and union
structure and unionstructure and union
structure and union
student
 

Was ist angesagt? (20)

Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Chapter 1 : Balagurusamy_ Programming ANsI in C
Chapter 1  :  Balagurusamy_ Programming ANsI in C Chapter 1  :  Balagurusamy_ Programming ANsI in C
Chapter 1 : Balagurusamy_ Programming ANsI in C
 
Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.Printing different pyramid patterns of numbers,alphabets and stars using C.
Printing different pyramid patterns of numbers,alphabets and stars using C.
 
Ansi c
Ansi cAnsi c
Ansi c
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in c
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in C
 
Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Chapter 5 exercises Balagurusamy Programming ANSI in c
Chapter 5 exercises Balagurusamy Programming ANSI  in cChapter 5 exercises Balagurusamy Programming ANSI  in c
Chapter 5 exercises Balagurusamy Programming ANSI in c
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
String C Programming
String C ProgrammingString C Programming
String C Programming
 
Bubble in link list
Bubble in link listBubble in link list
Bubble in link list
 
Functions in c language
Functions in c languageFunctions in c language
Functions in c language
 
structure and union
structure and unionstructure and union
structure and union
 
C Programming Unit-1
C Programming Unit-1C Programming Unit-1
C Programming Unit-1
 
Strings in c
Strings in cStrings in c
Strings in c
 
5bit field
5bit field5bit field
5bit field
 
Function lecture
Function lectureFunction lecture
Function lecture
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Friend function
Friend functionFriend function
Friend function
 

Kürzlich hochgeladen

Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Kürzlich hochgeladen (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 

Let us c chapter 4 solution

  • 1. Let us c(by yashwant kanetkar) chapter 4 solution 5th edition Exercise:- [A] (a). Heart I thought one wears a suite (b). I am in case 3 (c). Pure Simple Egghead! (d). Customers are dicey Markets are pricey Investers are moody At least employees are good (e). Trapped (f). You entered a and b
  • 2. (g). Feeding fish Weeding grass mending roof Just to servive [B] (a). After switch semicolon ( ' ; ' ) is written which is wrong incorrect statement:-switch(suite); correct statement:-switch(suite) (b). In the case statement we never used the expression o we only write the integer in the case statement. (c). We can not write floating value inside the switch and case statement we can only write integer value. (d). We only write the integer value in the case statement not the expression of integer constant or the expression of integer variable. [D] /*To find grace marks using switch*/ #include<stdio.h> void main() { int sub,cls; printf("Enter the no. of subjects in which a student has failedn"); scanf("%d",&sub);
  • 3. printf("enter the class through which the student has passed(write 1 instead of 1st div.,write 2 instead of 2nd div.,write 3 instead of 3rd div.n"); scanf("%d",&cls); switch(cls) { case 1: switch(sub) { case 1: printf("grace marks=5n"); break; case 2: printf("grace marks=10n"); break; case 3: printf("grace marks=15n"); break; default: printf("No grace marksn"); } break; case 2: switch(sub) { case 1: printf("grace marks=4n"); break; case 2: printf("grace marks=8n"); break;
  • 4. default: printf("no grace marksn"); } break; case 3: switch(sub) { case 1: printf("grace marks=5n"); break; default: printf("No grace marksn"); } } } THANKS.............