Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

QUESTION 1 (a) Write a C program that converts the given temperature in Fahrenheit to Celsius using the following conversion formula: F 32 1.8 C-

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

QUESTION 1 (a) Write a C program that converts the given temperature in Fahrenheit to Celsius using the following conversion formula: F 32 1.8 C- 10] (b) Write a C program to accept a number, check whether the number is a prime number or not and print the result. (c) Write a C program to print the first N Fibonacci numbers. Note: The Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, N where each number is the sum of the preceding two. [10] QUESTION 2 a) Write a C program to sort an aray in ascending order b) Explain in detail about looping statements in C Progranming. Write the program 10] syntax and example program for each looping statements. [10] . while loop . do while loop . for loop c) Wrte aprogram to find whether amumber is even or odd 5 QUESTION 3 (a) Write a program to print a half pyramid triangle *.[10] b) What is an operator? Explan the anithmetic, relational logical and assignment operators in C language. Illustrate with program constructs. c) Wnte a program to calculate the area ofa circle. [10] QUESTION 4 Find the output or errors) for the following programs snippets a. void main) int const * p#5; printf ("id",+tp) b. int main() int i int i=10; printf (d,) c. Explain the result of the following program # include int main() int i-l for printf(din", itt)i if (i 10) break; return 0; d. Point out the error, if any in the following programs # include int main () int i=1; while) printf("edin", itt)i if (i>10) break: return 0 a. What is the difference between a local variable and a global variable?[ marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions