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

Programming_For_Problem_Solving_Suggestion

The document outlines a series of programming tasks and concepts related to problem-solving in C. It includes explanations and examples for various topics such as operators, loops, recursion, data structures, and memory allocation. Additionally, it provides programming challenges like finding the largest number, checking even/odd, and creating a simple calculator.

Uploaded by

manojgamer.15464
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)
4 views

Programming_For_Problem_Solving_Suggestion

The document outlines a series of programming tasks and concepts related to problem-solving in C. It includes explanations and examples for various topics such as operators, loops, recursion, data structures, and memory allocation. Additionally, it provides programming challenges like finding the largest number, checking even/odd, and creating a simple calculator.

Uploaded by

manojgamer.15464
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

Programming For Problem Solving

Suggestion
1. Explain the ternary operator with a proper example.

2. Differentiate between a compiler and an interpreter.

3. Describe the difference between an exit-controlled loop and an entry-controlled


loop with example.

4. Write a program to find the largest number among three numbers using conditional
statements.

5. Differentiate between call by value and call by reference with an example.

6. Describe two types of increment & decrement operators with proper coding
examples.

7. Explain the concept of recursion in C. Write a program to find the factorial of a


number using recursion.

8. Write a short program to swap two numbers using pointers.

9. Explain the structure in C. Provide an example to store student details.

10. What is the difference between while and do-while loops? Give examples.

11. What are logical operators in C? Explain && , || , and ! with truth table and
examples.

12. Write a C program to check whether a number is even or odd using functions.

13. What are header files in C? Mention four common ones with their uses.

14. Explain storage classes in C: auto , static , register , extern .

15. Write a program in C to count the number of vowels in a string.

16. (a) Write a program in C to print the following pattern:

1
22
333
4444
55555

(b) Write a program to input a number and check whether it is a


4-digit number or not. If yes, find the sum of first and last digit.

Programming For Problem Solving Suggestion 1


17. (a) Write the definition of array with an example.
(b) State the advantages and disadvantages of using arrays.
(c) Explain break and continue keywords with examples.

(d) What is the scope of a variable in C?

18. (a) Explain type casting with example.


(b) Predict the output of the given code
(c) Write a program in C to calculate

s = 1 + 11 + 111 + ... n terms

19. Write a program in C to reverse a number and check whether it is a palindrome.


Explain with suitable examples.

20. Write a function in C to sort an array in ascending order using the bubble sort
algorithm.

21. Write a C program to create a simple calculator using switch statement that performs
+, –, *, /.

22. Write a program in C to generate Fibonacci series up to n terms using loops and
functions.

23. Explain the use of dynamic memory allocation using malloc() and free() with example.

24. Define a structure with nested structure. Write a program to input and display data
using that.

25. Explain the difference between local and global variables with an example program.

Programming For Problem Solving Suggestion 2

You might also like