[Link].
a Write a program to print different data types in ‘C’
and their sizes
Aim
To write a program to print different data types in ‘C’ and their sizes.
Algorithm
Step:1: Start the Program.
Step:2: Declare the necessary header files.
Step:3: Use the “sizeof()” operator to display the size of
each datatype.
Step:4: Print the values.
Step:5: Stop the program.
Flow chart
[Link].b Write a program to declare variables of different data types get
the value from the user & print the values
Aim
To write a program to declare variables of different data types get the value from
the user and print the values.
Algorithm
Step:1 :Start the Program.
Step:2: Declare the necessary header files.
Step:3: Read the input values.
Step:4: Print the values,
Step:5: Stop the program.
Result
Thus, the program to declare variables of different data types get
the value from the user and print the values was executed.
[Link].a Write a program to demonstrate arithmetic operators
Aim
To write a program to demonstrate arithmetic operators.
Algorithm
Step:1: Start the Program.
Step:2: Declare the necessary header files and variables.
Step:3: Read the input from the user.
Step:4: Perform addition, subtraction, multiplication and
division.
Step:5: Print the result.
Step:6: Stop the Program.
Result
Thus, the program to demonstrate arithmetic operators was
executed.
[Link].b Write a program to demonstrate increment, decrement, ternary
and compound assignment operators
Aim
To write a program to demonstrate increment, decrement, ternary and
compound assignment operators.
Algorithm
Step:1: Start the Program.
Step:2: Declare the necessary header files and variables.
Step:3: Get the input from the user.
Step:4: Increment the value using increment operator.
Step:5: Print the result.
Step:6: Use pre-decrement and post-decrement operator.
Step:7: Print the result.
Step:8: Read the value of a and b,
Step:9: Print the large number using ternary operator.
Step:10: Read the in value for compound assignment.
Step:11: Calculate all the asthmatic operation using
compound assignment.
Step:12: Stop the Program.
Result
Thus the program to demonstrate increment, decrement, ternary and compound
assignment operators was written and executed successfully.
[Link].c
Write a program to calculate simple interest and compound interest
Aim
To write a program to calculate simple and complex interest.
Algorithm
Step:1:Start the Program.
Step:2:Declare the necessary header files and variables.
Step:3:Read the input of x and y from the user.
Step:4:Check x and y values, if x is greater than y, print 1 otherwise 0.
Step:5:Check x and y values, if x is greater than or equal to y, print 1
otherwise 0.
Step:6:Check x and y values, if x is smaller than y, print 1 otherwise 0.
Step:7:Check x and y values, if x is smaller than or equal
to y, print 1 otherwise 0.
Step:8 Print 1 if x is equal to y, otherwise
print 0.
Step:9 Print 1 if x is not equal to y,
otherwise print 0.
Step:10 Stop the program.
Result
Thus the program to calculate simple and compound interest was written
and executed successfully.