*Declaration: I thereby declare that all the content within this file is not copied and had done directly by
me during my coursework in college
Content list.
1) Write a program to calculate salary of an employee, given his basic pay (to be entered by the
user). HRA is 10% of the basic pay; TA is 5% of the basic pay. Calculate the Gross salary of an
employee.
2) Write a program to calculate the area and circumference of a circle.
3) Write a program to enter any alphabet in small case and display it in upper case.
4) Write a program to enter any alphabet in upper case and display it in lower case.
5) Write a program to read roll no., age, and gender of a student and display the details of a student
with proper headline for each variable.
6) Write a program to convert degree Fahrenheit into degree Celsius.
7) Write a program to check whether the given number is even or odd.
8) Write a program to check whether the given number is positive, negative or zero.
9) Write a program to find the greatest of three numbers.
10) Write a program to check whether the input character entered by user is lower case, upper case,
digit or special symbol.
11) Write a program to find profit and loss for a given cost price and selling price.
12) Implement calculation with following functionality: Addition, Subtraction, Multiplication,
Division, using switch case.
13) Write a program to print a multiplication table of any number.
14) Write a program to find a reverse of a given number.
15) Write a program to find the sum and multiplication of individual digits of the entered number.
16) Write a program to check whether the given number is Armstrong number or not.
17) Write a program to check whether the given number is palindrome number or not.
18) Write a program to find the Factorial of a given number.
Computer Programming (C language) Page 1
, 19) Write a program to find the Fibonacci series of n numbers entered by the user.
20) Write a program to print the Floyd's triangle.
21) Write a program to find the sum of marks of n students using array.
22) Write a program to find the addition of two 2-Dimensional matrixes.
23) Write a program to find the multiplication of two 2-Dimensional matrixes.
24) Write a program to enter your name and print it.
25) Write a program to enter any sentence and find out its total length.
26) Write a program to enter any string and print its reverse.
27) Write a program to enter any string and find the number of vowels and consonants in it.
28) Write a program to enter any string and find out how many times a particular character is present
in it.
29) Write a program to enter any two strings and concatenate those two strings.
30) Write a Program to swap two numbers using call by value.
31) Write a Program to swap two numbers using call by reference.
32) Write a Program to Write a string in the file named in-file and then read the string from it
convert it to upper case and write it to out-file.
Computer Programming (C language) Page 2
, EXPERIMENT – 1
AIM: Write a program to calculate salary of an employee, given his basic pay (to
be entered by the user). HRA is 10% of the basic pay; TA is 5% of the basic pay.
Calculate the Gross salary of an employee.
Coding:
#include<stdio.h>
#include<stdio.h>
void main()
{
float BS,GS,TA,HRA;
clrscr();
printf("\n Enter the basic salary of an employee");
scanf("%f",&BS);
TA=BS*5/100;
HRA=BS*10/100;
GS=BS+TA+HRA;
printf("\n The Gross salary of an employee is %f",GS);
getch();
}
Output:
:
Computer Programming (C language) Page 3
, EXPERIMENT - 2
AIM: Write a program to calculate the area and circumference of a circle.
Coding:
#include<stdio.h>
#include<conio.h>
void main()
{
float a,area,circum;
clrscr();
printf("\n Enter the radius of a circle, ");
scanf("%f",&a);
area= a*a*3.14;
circum= 2*3.14*a;
printf("\n The area of a circle is %f",area);
printf("\n The circumference of a circle is %f",circum);
getch();
}
Output:
Computer Programming (C language) Page 4