Basic algebra formulas that you can revise anytime and anywhere

FORMULAS FOR BEGINNER (a+b) ^2= a^2+b^2+2ab (a+b) ^2= (a-b) ^2+4ab (a-b) ^2= a^2+b^2-2ab (a-b) ^2= (a+b) ^2-4ab a^2+b^2= (a+b) ^2-2ab a^2+b^2= (a-b) ^2+ 2ab a^2-b^2= (a+b) (a-b) (a+b+c) ^2= a^2+b^2+c^2+2(ab+bc+ac) (a-b-c) ^2= a^2+b^2+c^2-2(ab-bc+ac) (a+b) ^3= a^3+b^3+3ab(a+b) (a-b) ^3= a^3-b^3+3ab(a-b) a^3+b^3= (a+b) (a^2-ab+b^2) a^3-b^3= (a-b) (a^2+ab+b^2) a^4-b^4= (a^2-b^2) (a^2+b^2) = (a^2+b^2) (a+b) (a-b) a^5+b^5= (a+b) (a^4-a^3b+a^2b^2-ab^3+b^4) a^5-b^5= (a-b) (a^4+a^3b+a^2b^2+ab^3+b^4)

Area and volume related c programming codes




Area of triangle

#include < stdio.h >
void main()
{
int height, base;
float ans;
printf("Enter height and base");
scanf("%d %d",&height, &base);
ans= (1/2)*height*base;
printf("Area if triangle is %f",ans);
}


Area of Circle

#include < stdio.h >
#include < math.h >
#define PI 3.142
void main()
{
float radius, area;
printf("Enter the radius of a circle \n");
scanf("%f", &radius);
area = PI * pow(radius, 2);
printf("Area of a circle = %5.2f\n", area);
}


Area of Rectangle

#include < stdio.h >
#include < conio.h >
int main() {
int length, breadth, area;
printf("\nEnter the Length of Rectangle : ");
scanf("%d", &length);
printf("\nEnter the Breadth of Rectangle : ");
scanf("%d", &breadth);
area = length * breadth;
printf("\nArea of Rectangle : %d", area);
return (0);
}


Area of Square

#include < stdio.h >
int main() {
int side, area;
printf("\nEnter the Length of Side : ");
scanf("%d", &side);
area = side * side;
printf("\nArea of Square : %d", area);
return (0);
}


Volume of Cube

#include < stdio.h >
void main()
{
float a;
float surface_area,volume;
printf("Enter size of any side of a cube : ");
scanf("%f",&a);
surface_area = 6 * (a * a);
volume = a * a * a;
printf("Surface area of cube is: %.3f",surface_area);
printf("\nVolume of cube is : %.3f",volume);
}


Volume of Cylinder

#include < stdio.h >
void main()
{
float vol,pie=3.14;
float r,h;
printf("ENTER THE VALUE OF RADIOUS :- ");
scanf("%f",&r);
printf("ENTER THE VALUE OF HEIGHT :- ");
scanf("%f",&h);
vol = pie * r * r * h;
printf("VOLUME OF CYLINDER IS :- %3.2f ",vol);
}


Volume of Sphere

#include < stdio.h >
#include < math.h >
void main()
{
float radius,pie,volume;
pie=3.1416;
printf("Enter the radius:");
if(scanf("%f",&radius)==1)
{
volume=(4/3)*pie*pow(radius,3);
printf("The volume is :%6.2f",volume);
}
else
{
printf("error ,enter correct value");
}
}




These are the Concept of C programming codes We'll be glad if you share your valuable information with us regarding this topic, then it will be a golden opportunity for all of us to improve ourselves and know more. Comment below!!

Comments

Popular posts from this blog

How to answer " What are your goals?"(HR QUESTION)

Basic algebra formulas that you can revise anytime and anywhere