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

C Programming Exercises and Solutions

The document lists various C programming tasks, including checking if a number is even or odd, calculating factorials, displaying month and day names, finding GCD and LCM, checking for prime numbers, and manipulating strings. It also includes tasks for working with arrays, performing mathematical operations, and implementing recursive functions. Each task is designed to enhance programming skills in C through practical exercises.

Uploaded by

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

C Programming Exercises and Solutions

The document lists various C programming tasks, including checking if a number is even or odd, calculating factorials, displaying month and day names, finding GCD and LCM, checking for prime numbers, and manipulating strings. It also includes tasks for working with arrays, performing mathematical operations, and implementing recursive functions. Each task is designed to enhance programming skills in C through practical exercises.

Uploaded by

khotaryu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1 Write a C program to check if the entered number is even or odd.

2 Write a C program to find the factorial of a number.

3 Write a C program to display odd numbers upto n.

4 Write a program to display the month name by accepting the month number from user.

5 Write a program to display the day name by accepting the day number from user.

6 Write a program to find the GCD and LCM of two numbers, using a function.

7 Write a program to check whether the number entered by user is prime or not, using a function.

8 Write a C program to find the factorial of a number, using a recursive function.

9 Write a C program to find n Fibonacci elements, using a recursive function.

n
10 Write a C program to find the value of y using a recursive function, where x=y .

11 Write a program to swap two numbers using a function. Pass the values to be swapped to this function using call by value method.

12 Write a program to swap two numbers using a function. Pass the values to be swapped to this function using call by reference method.

13 Write a program to check whether the entered string is palindrome or not.

14 Write a program to count blank spaces, digits, vowels and consonants in the string.

15 Write a C program to perform mathematical operations.

16 Write a C program to print a number in different number formats.

17 Write a C program to perform swapping of two numbers without using temporary variable.

18 Write a C program to accept a two digit number and display it in reversed form.

19 Write a C program to display the following asking the user for the number of lines.

12

123

1234

12345

123456

20 Write a C program to find the sum and product of all digits of a user entered using the while loop.

21 Write a program to find check whether the number entered by user is Armstrong or not, using a function.

22 Create a function to print prime numbers upto n.

23 Write a program to find the sum of elements of an array.


24 Write a program to find the maximum and minimum element of an array.

You might also like