0% found this document useful (0 votes)
214 views

C Lab 1

The document contains 41 tasks that involve writing C programs to perform various calculations (such as addition, multiplication, area/circumference of shapes, simple/compound interest), test conditions (checking if a number is even/odd, prime, leap year), and display sequences. Many tasks require using if/else and switch statements. The final task involves displaying the flag of Nepal using symbolic/HEX characters.

Uploaded by

bishwash neupane
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
214 views

C Lab 1

The document contains 41 tasks that involve writing C programs to perform various calculations (such as addition, multiplication, area/circumference of shapes, simple/compound interest), test conditions (checking if a number is even/odd, prime, leap year), and display sequences. Many tasks require using if/else and switch statements. The final task involves displaying the flag of Nepal using symbolic/HEX characters.

Uploaded by

bishwash neupane
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Write a program to display hello world in C.

2. Write a program to add two numbers (5&7) and display its sum.
3. Write a program to multiply two numbers (10&8) and display its product.
4. Write a program to calculate area of a circle having its radius (r=5).
5. Write a program to find area and circumference of a circle.
6. Write a program to convert temperature from degree centigrade to Fahrenheit
7. Write a program to find sum of 5 subjects and find percentage.
8. Write a program to swap two numbers.
9. Write a program to calculate area of an ellipse having its axes (minor=4cm, major=6cm).
10. Write a program to calculate simple interest for a given P=4000, T=2, R=5.5. (I = P*T*R/100)
11. Write a program to declare two integer and one float variables then initialize them to 10,
15, and 12.6. Also print the variable values in the screen.
12. Write a C program to prompt the user to input 3 integer values and print these values in
forward and reversed order.
13. Write a program to calculate simple and compound interest.
14. Write a program to swap two variables values with and without using third variables.
15. Write a program to check odd or even number.
16. Write a program to reverse digits of a three digit number.
17. Write a program to produce the output as shown below:

18. Given x=3.0, y=12.5, z= 523.3, A=300.0, B=1200.5, C=5300.3, Write a program to display the
following:

19. Write a program to find the largest and smallest among three entered numbers and also
display whether the identified largest/smallest number is even or odd.
20. Write a program to find greatest in 3 numbers.
21. Write a program to convert number into its equivalent days where 1 is Sunday, 2 is Monday,
7 is Saturday and so on using if else and switch statement. Use if and switch statement.
22. Write a program to check whether input alphabet is vowel or not using if-else and switch
statement.
23. Write a program to create a simple calculator that asks user two integer inputs and gives
options for following calculations:
a. Add (a+b)
b. Subtract(a-b)
c. Multiply(a*b)
d. Divide(a/b)

Complete the program using if and switch statement each.

24. Write a program that asks a number and test the number whether it is multiple of 5 or not,
divisible by 7 but not by eleven.
25. Write a program to check whether the entered year is leap year or not (a year is leap if it
is divisible by 4 and divisible by 100 or 400.)
26. Write a program to read the values of coefficients a, b and c of a quadratic equation
ax2+bx+c=0 and find roots of the equation.
27. Write a program to input two integer numbers and display the sum of even numbers
between these two input numbers.
28. Write a program to find GCD (greatest common divisor or HCF) and LCM (least common
multiple) of two numbers.
29. Write a program to display first 10 natural numbers and display their sum.
30. Write a program to find factorial of a number.
31. Write a program to find whether a given number is prime or not.
32. Write a program to display the sum of series 1+1/2+1/3+1/4++1/n
33. Write a program to display the series and find sum of 1+3+5++n
34. Write a program to get input of two or higher digit integer number and display in reverse
order.
35. Write a program to display Fibonacci series up to 100 terms.
36. Write a program to display Fibonacci series up to n terms where n is the number entered by
user.
37. Write a program to produce the following sequence:

38. Write a program to display the following sequence:


39. Write a program to display the following sequence:

40. Write a program to display the flag of Nepal using symbolic/HEX character in C.

41. Write a program to display the following.

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