0% found this document useful (0 votes)
53 views2 pages

2nd Year C

Uploaded by

Iqra Hanif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

2nd Year C

Uploaded by

Iqra Hanif
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

C language most important programs and questions long wise

1. Write a program that inputs two numbers from the user and checks if the
second number is the square of the first number.
2. Write a program that gets three numbers from the user and checks the
maximum number.
3. Write a program that gets a number from the user and checks whether it is
even or odd.
4. Write a program that gets two numbers from the user and checks whether it is
equal or not.
5. Write a program that inputs a year from the user and checks whether it is a
leap year or not.
6. Write a program that inputs a number from the user and checks whether it is
positive, negative, or zero.
7. Write a program that inputs radius from the user and calculates the area of a
circle if user enter 1 as choice and area of circumference if user enter 2 as
choice.
8. Write a program that inputs a month number and displays the number of days
in that month.
9. Write a program that inputs a character from the user and checks whether it is
a vowel or not.
10. Write a program that displays the first five numbers and their sum.
11. Write a program that displays the first five numbers with their squares and
cubes.
12. Write a program that inputs starting and ending numbers from the user and
displays all odd numbers between them.
13. Write a program that gets starting and ending numbers from the user and
displays even numbers between them.
14. Write a program that inputs a number and displays the output in reverse.like
345 to 543.
15. Write a program that inputs a number from the user and displays the
multiplication table of that number.
16. Write a program that displays the series: 3 5 7 9 11 13 ... 23.
17. Write a program that inputs a number and displays its factorial.
18. Produce the following output
***** part a
*****
*****
*****
*****
0 part b
0 1
0 1 4
0 1 4 9
0 1 4 9 16
0 1 4 9 16 25
0 1 4 9 16 25
19. Write a program that inputs two numbers and displays the result of the first
number raised to the power of the second number using a loop.
20. Write a program that prints the sum of odd numbers between 1 and 100.
21. Write a program that prints the series: 0 3 6 9 12 15.
22. Write a program that inputs the first five numbers from the user and displays
their average.
23. Write a program that displays grades based on user-input marks.
If >=90 A 80-89 B 70-79 C 60-69 D 50-59 E 40-49 F
24. Write a program that displays the sum of the series: 1 + 1/2 + 1/4 + 1/6 + ... +
1/100.

Chapter 8
1) Describe the characteristics of a high-level programming language.
2) Describe language processor or translator and their use. Discuss different
types of language processors.
3) Write some advantages or characteristics of the C language.
4) Briefly describe the basic structure of a C program.
5) While writing a C program, how many types of errors can occur? Discuss briefly
the types of errors that can occur.
Chapter 9
6) 1. Write down the rules for naming variables in C language with examples.
7) 2. What are operators? List different types of operators in C.
Chapter 11
8) 1. Explain the working of if control structure with the help of syntax, flow chart,
working, and example.
9) 2. Explain the working of switch control structure with the help of syntax, flow
chart, working, and example.
10) Explain the working of if-else control structure with the help of syntax, flow
chart, working, and example.
11) Explain the working of if-else if control structure with the help of syntax, flow
chart, working, and example.
12) Explain the working of nested if control structure with the help of syntax, flow
chart, working, and example.
Chapter 12
13) 1. Explain the working of while loop with the help of syntax, flow chart,
working, and example.
14) 2. Explain the working of do-while loop with the help of syntax, flow chart,
working, and example.
15) Explain the working of for loop with the help of syntax, flow chart, working,
and example.
16) Explain the working of nested loop with the help of syntax, flow chart, working,
example.

You might also like