Operators in C
Expression and Operators
- The symbols which are used to perform logical and mathematical operations in a C program are called C operators.
- These C operators join individual constants and variables to form expressions.
- Operators, functions, constants and variables are combined together to form expressions.
- Consider the expression A + B * 5.
- Where, +, * are operators, A, B are variables, 5 is constant and A + B * 5 is an expression.
Types of C operators
C language offers many types of operators.
- Arithmetic operators.
- Assignment operators.
- Relational operators.
- Logical operators.
- Bit wise operators.
- Conditional operators (ternary operators).
- Increment/decrement operators.
- Special operators.
Write a program to input number of days from user and display it, week and days format.
input is : 20 days
then output is:
2 week and 6 days.
Write a program to input number of days from user and display it, Month, Week and Days format. (consider 30days = 1 month)
input is : 50 days
output is: 1 month, 2 week and 6 days.
Write a C program which accept a character from user and ASCII Value of that character
Write a program which accept one integer number from user and print it.
Write a C Program to input any Character and Find its ASCII Value
Write a C Program to input dividend, divisor and Compute Quotient and Remainder
Write a C Program to Find the Size of int, float, double and char
Write a C Program to Swap Two Numbers
Write a C program to Swap Numbers Without Using Temporary(3rd) Variables
Write a C Program to input any number and Check number is Odd or Even Using the Ternary Operator