C Programming Lab

cropped-BG-1.png

1. Basics

Programs using I/O statements and expressions.

2. Decisions

Programs using decision-making constructs.

3. Leap Year ?

Write a program to find whether the given year is leap year or Not? (Hint: not every centurion year is a leap. For example 1700, 1800 and 1900 is not a leap year)

4. Calculator

Design a calculator to perform the operations, namely, addition, subtraction, multiplication, division and square of a number.

5. Armstrong number

Check whether a given number is Armstrong number or not?

6. Weight Generation

Given a set of numbers like <10, 36, 54, 89, 12, 27>, find sum of weights based on the following conditions.

  • 5 if it is a perfect cube.
  • 4 if it is a multiple of 4 and divisible by 6.
  • 3 if it is a prime number.

Sort the numbers based on the weight in the increasing order as shown below <10,its weight>,<36,its weight><89,its weight>

7. Array Operation

Populate an array with height of persons and find how many persons are above the average height.

8. Body-Mass-Index

Populate a two dimensional array with height and weight of persons and compute the Body Mass Index of the individuals.

9. String Reverse

Given a string ―a$bcd./fg‖ find its reverse without changing the position of special characters. (Example input:a@gh%;j and output:j@hg%;a)

10. Numeric Conversions

Convert the given decimal number into binary, octal and hexadecimal numbers using user defined functions.

11. Text Processing

From a given paragraph perform the following using built-in functions: a. Find the total number of words. b. Capitalize the first word of each sentence. c. Replace a given word with another word.

12. Recursion

Solve towers of Hanoi using recursion.

13. Sort | Pass by Reference

Sort the list of numbers using pass by reference.

14. Structures and Pointers

Generate salary slip of employees using structures and pointers.