0% found this document useful (0 votes)
31 views1 page

40C Exercise

Uploaded by

dinesganeshan
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)
31 views1 page

40C Exercise

Uploaded by

dinesganeshan
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/ 1

100 Practice Exercise

Section – I (Beginner)
1 Write a C program to convert specified days into years, weeks, and days.
2 Write a C program that accepts five integers and finds the maximum of five.
3 Write a C program to read an amount (integer value) and break the amount into the smallest possible number of bank notes.
4 Write a C program to convert a given integer (in seconds) to hours, minutes, and seconds.
5 Write a C program to print the roots of quadratic equations from the given three floating numbers coefficients. Display a message if it is not possible to find
the roots.
6 Write a C program that reads 5 numbers and sums all odd values between them.
7 Write a C program that reads three floating-point values and checks if it is possible to make a triangle with them. Determine the perimeter of the triangle if
the given values are valid.
8 Write a C program that prints all even numbers between 1 and 50 (inclusive).
9 C program to check if two numbers in a pair are in ascending order or descending order.
10 C program to calculate the sum of all numbers not divisible by 17 between two given integer numbers.
11 C program that reads two integers p and q, prints p number of lines in a sequence of 1 to b in a line.
12 C program to calculate the average mathematics marks of some students. Input 0 (excluding to calculate the average) or a negative value to terminate the
input process.
13 C program that finds all the divisors of an integer.
14 C program to read and print the elements of an array with length 7. Before printing, insert the triple of the previous position, starting from the second
position.
For example, if the first number is 2, the array numbers must be 2, 6, 18, 54 and 162.
15 C program to read an array of length 6, change the first element by the last, the second element by the fifth and the third element by the fourth. Print the
elements of the modified array.
16 C program to reverse and print a given number.
17 C program to evaluate the slope of a line given two points.
18 C program to check the Armstrong number of n digits.
19 C program to find the length of a string without using the library function.
20 C program to print a string in reverse order.
21 C program to convert a decimal number to hexadecimal.
22 C to find the LCM of any two numbers.
23 C program to find the HCF (Highest Common Factor) of two numbers.
24 To find the number and sum of all integers between 100 and 200 which are divisible by 9.
25 C program to check whether a number is a palindrome or not.
26 To display the number in reverse order.
27 To display the first n terms of the Fibonacci series.
28 Program to print Floyd's Triangle.
29 To find the sum of the series 1 +11 + 111 + 1111 +.. n terms.
30 Program to display Pascal's triangle.
31 C program to find the largest value from the first, last, and middle elements of a given array of integers of odd length.
32 C program to check whether the number of 3's is greater than the number of 5's.
33 C program to check a given array of integers. The program will return true if the given array contains either 2 even or 2 odd values all next to each other.
34 C program to create an array taking two middle elements from a given array of integers of length even.
Eg:
Elements in original array : 1, 5, 7, 9, 11, 13
New array: 7, 9
35 C program to shift an element in the left direction and return a newly created array.
Eg:
Elements in original array : 10, 20, 30, 40
Elements in new array : 20, 30, 40, 10
36 C program to display such a pattern for n rows using a number that starts with 0 and each row will have a 0 as the first and last number. 0
020
02320

37 C program to make such a pattern like a pyramid with a number which will repeat the number in the same row.
1
2 2
3 3 3
4 4 4 4
38 C program to check if the value of each element is equal or greater than the value of the previous element of a given array of integers.
39 C program to create a new array from a given array of integers shifting all zeros to left direction.
Eg:
Elements in original array : 1, 2, 0, 3, 5, 7, 0, 9, 11
Elements in new array : 0, 0, 1, 3, 5, 7, 2, 9, 11
40 C program to create a new array taking the elements before the element value 5 from a given array of integers.
Eg:
Elements in original array : 1, 2, 3, 5, 7
Elements in new array : 1, 2, 3

You might also like