C Programming : Simple Programs (BIM – TU)

By Ashesh Neupane

This page collects several simple programs of C Programming specially for students of BIM. This page can also be utilized by the beginners who are intersted in learning C programming. If you want to do good at college, or do your assignments, projects, utilize this page to the best ability. If you have any confusion or questions, feel free to contact us.

  1. Write a program to find area of circle.
#include<stdio.h>
#include<conio.h>
void main()
{
    float pi,r,area;
    clrscr();
    printf("Enter the radius of circle :");
    scanf("%f",&r);
    pi=3.14;
    area=pi*r*r;
    printf("The area of circle is : %f",area);
    getch();
}
Enter the radius of circle : 4
The area of circle is : 50.240002

2. Write a program to find volume of cylinder.

#include<stdio.h>
#include<conio.h>
void main()
{
    float pi,r,h,vol;
    clrscr();
    printf("Enter the radius of cylinder :");
    scanf("%f",&r);
    printf("Enter the height of cylinder :");
    scanf("%f",&h);
    pi=3.14;
    vol=pi*r*r*h;
    printf("The volume of cylinder is : %f",vol);
    getch();
}
Enter the radius of cylinder : 5
Enter the height of cylinder : 7
The volume of cylinder is : 549.500000

3. WAP to input temperature in Fahrenheit and convert into Celsius.

#include<stdio.h>
#include<conio.h>
void main()
{
    float f,c;
    clrscr();
    printf("Enter the temperature in fahrenheit :");
    scanf("%f",&f);
    c=(f-32)*0.56;
    printf("The temperature in celsius is : %f",c);
    getch();
}
Enter the temperature in fahrenheit : 56
The temperature in celsius is :  13.440000

4. WAP to input a number and find its square root.

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
    float a,b;
    clrscr();
    printf("Enter a number :");
    scanf("%f",&a);
    b=sqrt(a);
    printf("The square root of the given number is : %f",b);
    getch();
}
Enter a number : 25
The square root of the given number is : 5.000000

5. WAP to input 3 numbers and find their average.

#include<stdio.h>
#include<conio.h>
void main()
{
    float a,b,c,avg;
    clrscr();
    printf("Enter any three numbers :");
    scanf("%f%f%f",&a,&b,&c);
    avg=(a+b+c)/3;
    printf("The average of the numbers is : %f",avg);
    getch();
}
Enter any three numbers : 3 6 9
The average of the numbers is : 6.000000

6. WAP to input find Simple Interest.

#include<stdio.h>
#include<conio.h>
void main()
{
    float p,t,r,si;
    clrscr();
    printf("Enter the principle :");
    scanf("%f",&p);
    printf("Enter the time :");
    scanf("%f",&t);
    printf("Enter the interest rate:");
    scanf("%f",&r);
    si=(p*t*r)/100;
    printf("The simple interest is : %f",si);
    getch();
}
Enter the principle : 1000
Enter the time : 1
Enter the interest rate: 10
The simple interest is : 100.000000

7. WAP to two number find the cube of first number, square of second number and then add those result to find the new result.

#include<stdio.h>
#include<conio.h>
void main()
{
    float a,b,cube,square,result;
    clrscr();
    printf("Enter the two numbers:");
    scanf("%f%f",&a,&b);
    cube=a*a*a;
    printf("The cube of the first number is : %f \n",cube);
    square=b*b;
    printf("The square of the second number is : %f\n",square);
    result=cube+square;
    printf("The sum of cube and square is : %f",result);
    getch();
  }
Enter the two numbers: 2 3
The cube of the first number is : 8.000000
The square of the second number is : 9.000000
The sum of cube and square is : 17.000000

Ashesh Neupane is the Co-Founder and Former Admin of HighApproach. He is also a student of Bachelor of Information Management (BIM) at Tribhuvan University.

1 thought on “C Programming : Simple Programs (BIM – TU)”

Leave a Comment

Slide to prove you're not a bot/spammer *