Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For all the quetsions PROBLEM SOLVING THROUGH C(P21CS203) ASSIGNMENT I Class: II Semester B Section Date: 18/07/2022 Sl.No. Questions 1. Define algorithm. i) Write algorithm
For all the quetsions
Note: Submit Assignment I before 30/07/2022
PROBLEM SOLVING THROUGH C(P21CS203) ASSIGNMENT I Class: II Semester B Section Date: 18/07/2022 | |
Sl.No. | Questions |
1. | Define algorithm. i) Write algorithm to find all the roots of a quadratic equation ax2+bx+c=0 ii) Write algorithm to find area & perimeter of rectangle. iii)Write algorithm to find even numbers between 1 and 50. |
2. | Define flowchart. i) Write a flowchart to find largest of three numbers. ii) Write a flowchart to find if a given number is prime or not. iii) Write a flowchart to find factorial of a given number. |
3. | Write the characteristics/properties of an algorithm. |
4. | Explain the basic structure of C program. |
5. | What is operator? Explain all the operators available in C with example. |
6. | Evaluate the following expressions. i) 6*2/ (2+1 * 2/3 + 6) + 8 * (8/4) ii) 17-8/4*2+3-++a where a=6. iii) (a>b)? ((a>c)?a:c): ((b>c)?b:c) where a=2,b=5,c=7. iv) 2v)x * y vi) 3 * (5+2) / 2- 4++ * 2+6 * 3 && 5 || (4/1) |
7. | Explain formatted input and output statement with syntax and example. |
8. | Write C program which display the grade of student using else if ladder based in the given conditions: If the marks scored by student is
|
9. | Using Switch statement, write a program that displays the following menu for the food items available to take order from the customer: B= Burger F= French Fries P= Pizza S= Sandwiches The program inputs the type of food and quantity. It finally displays the total charges for the order according to following criteria: Burger = Rs. 200 French Fries= Rs. 50 Pizza= Rs. 500 Sandwiches= Rs. 150 |
10. | Write a C program to convert given number (between 1 to 5) into words using switch. |
11. | Write a C program to convert given uppercase letter to a lowercase letter and vice-versa using if-else statement. |
12. | Write a program to check if a given four digit number is a palindrome or not. |
13. | Suppose there are 20 students in a class. Each student obtains marks in range 0-100. Write a program to count number of student in following groups .Poor (0-25), Average (26-50), Good (51-75), Excellent (76-100). |
14. | Define array. List and explain the various ways to initialize 1D-array. |
15. | Write a program in C to print all unique elements in an array |
16. | Write a c program to check if the array elements are sorted or not.If not sorted apply bubble sort to sort the elements in descending order. |
17. | Write a c program to find the product of two matrices. |
18. | Write a C program to check if the given matrix is an identity matrix or not. |
Attachments:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started