C Float Data Type

Get Certified in C Programming and Take Your Skills to the Next Level

Program 1

#include<stdio.h>
#include<conio.h>
int main()
{
      system("cls");
      float A,r,C;
      const float PI=3.14;
      printf("'\nEnter redious");
      scanf("%f",&r);
      A=PI*r*r;
      C=2*PI*r;
      printf("\nArea is %f",A);
      printf("\nCircumfrance is %f",C);
    return 0;
}

Program 2

// Mark sheet of Student
#include<stdio.h>
#include<conio.h>
int main()
{
    int h,e,m,c,total;
    float per;
    system("cls");
    printf("Enter marks of hindi");
    scanf("%d",&h);
    printf("Enter marks of english");
    scanf("%d",&e);
    printf("Enter marks of maths");
    scanf("%d",&m);
    printf("Enter marks of computer");
    scanf("%d",&c);
    total=h+e+m+c;
    printf("\n Total Marks is: %d",total);
    per=total/4.0;
    printf("\nPercentage is %.2f:",per);
    
    return 0;
}

 

Your 15 seconds will encourage us to work even harder
Please share your happy experience on Google

courses

DataFlair Team

DataFlair Team provides high-impact content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. We make complex concepts easy to grasp, helping learners of all levels succeed in their tech careers.

Leave a Reply

Your email address will not be published. Required fields are marked *