Q-1.Use the printf statement and do the following:
Print out the value of the integer variable sum
Print out the text string “Welcome”, followed by a new line.
Print out the character variable letter
Print out the float variable discount
Print out the float variable dump using two decimal places.
Print out the value of the integer variable sum
Print out the text string “Welcome”, followed by a new line.
Print out the character variable letter
Print out the float variable discount
Print out the float variable dump using two decimal places.
Q-2.Use the printf statement and do the following:
To read a decimal value from the keyboard, into the integer variable sum
To read a float variable into the variable discount rate.
To read a decimal value from the keyboard, into the integer variable sum
To read a float variable into the variable discount rate.
Q-3.Write a C program which prints the ASCII values of the characters ‘A’ and
‘b’.
Q-4.Consider the following program:
#include
void main ()
int breadth;
float length, height;
scanf (“%d%f%6.2f”, breadth, length, height);
printf (“%d %f %e”, &breadth, length, height);
Correct the errors in the above program.
#include
void main ()
int breadth;
float length, height;
scanf (“%d%f%6.2f”, breadth, length, height);
printf (“%d %f %e”, &breadth, length, height);
Correct the errors in the above program.
Q-5.Write a C program which takes name, basic, daper (i.e., percentage of D.A),
bonper (i.e., percentage bonus) and loandet (loan amount to be debited)
for an employee. Calculate the salary using the following relation:
salary = basic + basic * daper /100 +bonper * basic/100 – loandet
Data is:
Calculate salary and then print the result under the following headings. (Salary to be printed to the nearest dollar.)
bonper (i.e., percentage bonus) and loandet (loan amount to be debited)
for an employee. Calculate the salary using the following relation:
salary = basic + basic * daper /100 +bonper * basic/100 – loandet
Data is:
Name | Basic | Daper | Bonper | Loandet |
---|---|---|---|---|
MARK | 2500 | 55 | 33.33 | 250.00 |
Calculate salary and then print the result under the following headings. (Salary to be printed to the nearest dollar.)
Name | Basic | Salary |
---|
Q-6.Write a C program that asks for your first name and last name, and then
prints the names in the format last name, first name.
Q-7.Write a C Program to find the size of int, float, double and char.
Q-8.Write a C program to find area and circumference of circle.
.
Q-9.Write a C program to find area of equilateral triangle.
Q-10.Write C program to take name, address, age and height in feet (a float
value should be entered), print all values in new lines.