Use only C language. Question 1 Find and explain error(s) if any. Rewrite following program using if statements. int main() { float f=2.3; switch(f) { case 2.1: printf("2.1"); break; case 2.2: printf("2.2"); break; case 2.3: printf("2.3"); } return 0; }
Use only C language. Question 1 Find and explain error(s) if any. Rewrite following program using if statements. int main() { float f=2.3; switch(f) { case 2.1: printf("2.1"); break; case 2.2: printf("2.2"); break; case 2.3: printf("2.3"); } return 0; }
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 7PP
Related questions
Question
Use only C language.
Question 1
Find and explain error(s) if any. Rewrite following program using if statements. int main() { float f=2.3; switch(f) { case 2.1: printf("2.1"); break; case 2.2: printf("2.2"); break; case 2.3: printf("2.3"); } return 0; }
Question 2
Write C statements to tokenize the given string and print tokens on the screen char str[50] = “99+2+4+0+5+7 100 900”; (Note: Tokenize the string separated by + sign and space.). Single line text.
Question 3
Complete the code given below to find out the maximum even number in the given array. #include<stdio.h> #define SIZE 5 void find_maxeven(int a[],int s); int main() { int array[SIZE] = {9,2,3,4,1}; int choice; do{ printf("\nMax Even value = %d", find_maxeven(array,SIZE)); printf("Enter 0 to exit:") scanf("%d",&choice); }while(); //Part 1 return 0; } float find_maxeven(int a[],int s); { int max; //Parrt 2 return max; }
Question 4
For the following struct FOO create a variable using new name of struct FOO type given by you and pass that variable to function by reference.The function will print the values on the screen Struct FOO { int x; float y; };.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 5 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr