Question Bank 2024 PPS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

1.

Write a program to compute the addition, subtraction, product, quotient and remainder of two given numbers using Switch
statement.
2. Write a program to convert temperature from degree centigrade to Fahrenheit. °F = °C*9/5+32
3. Write a program to swap the values of two variables without using a temporary variable.
4. Write a program to print the odd and even numbers within a given range.
5. Write a program to find the factorial of a given number.`
6. Write a program to print the sum of digit of a given number.
7. Write program to print the Fibonacci series up to a given number.
1. Write a program to print the prime numbers within a given range.
9. Write a C Program to Find Largest Number Among Three Numbers
10. Write a C Program to Find LCM of Two Numbers
11. Write a C program to Calculate the Area of a Circle/Triangle using Macro i.e. #define.
12. Write a C Program to Check Leap Year
13. Write a C program to check if string is palindrome or not.
14. Write a C Program to count the Number of Even/Odd from a given range.
15. Write a program to print the following pattern
(Take number of lines as input from the user).
**** or *
*** **
** ***
* ****
16. Predict the output of the following C program:
#include <stdio.h>
int main()
{
int i = 0;
for(i = 0; i < 10; i++) {
if(i == 2) {
continue;
}
printf("i = %d\n", i);
}
return 0;
}

17. Predict the output of the following C program:


#include <stdio.h>

int main() {
int i = 0;

for(i = 0; i < 10; i++) {


printf("i = %d\n", i);
if(i == 5) {
goto skip;
}
}
skip:
printf("Loop exited.\n");
return 0;
}
18. Predict the output of the following C program:
#include <stdio.h>
int main() {
int i = 0;
for(i = 0; i < 10; i++) {
if(i == 8) {
break;
}
printf("i = %d\n", i);
}
printf("Bye Bye.\n");
return 0;
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy