Assignemnt
Assignemnt
2. Write a C program to demonstrate the use of printf() and scanf() statements to read and print
values of variables of different data types.
6. Write a C program to illustrate the use of unary prefix/ postfix increment and decrement
operators.
7. Write a C program to find the largest of two numbers using ternary operator.
9. Write a C program to read a character in upper case and then print in lower case.
11. Write a C program to convert a floating-point number into the corresponding integer and vice
versa.
Assignement-1
12. Write a C program to perform addition, subtraction, division, and multiplication on two integers
and two floating point numbers.
13. Write a C program to swap two numbers using and without using a temporary variable.
14. Write a C program to calculate the distance between two points.
15. Write a C program to calculate the area of a triangle using Hero’s formula.
Relational Operators
Logical Operators
Shorthand Assignment
Unary Operators
Conditional Operators
Bitwise Operators
Comma Operator
4. Write a C program to show the use of isalpha(), isdigit(), isprint() and isspace() functions with if.
5. Write a C program to enter number from 1 to 7 and display the corresponding day of the week
using switch case statement.
7. Write a C program to calculate the sum of numbers from m to n using while loop.
8. Write a C program to display the square and cube of first n natural numbers using do-while loop.
* 1
********** ** 12 1
********** 123454321
10. Write a program in C using for loop to calculate the factorial of a number.
14. Write a C program to enter any character and then determine whether it is a vowel or not using
if-else.
15. Write a C program to find whether a given year is a leap year or not considering also the century
year condition using if-else.
16. Write a C program using if-else-if, to calculate tax, given the following conditions:
Income > 150000 and <= 300000, then charge 10% tax.
Income > 300000 and <= 500000, then charge 20% tax.
17. Write a C program to find the greatest of three numbers using && and
if-else-if.