0% found this document useful (0 votes)
20 views10 pages

Table Progam

The document contains multiple C programs that implement a simple calculator with various functionalities, including addition, subtraction, multiplication, division, exponentiation, and generating multiplication tables. Each program prompts the user for input and performs calculations based on the selected operation. Additionally, one program includes functionality to solve quadratic equations.

Uploaded by

harshyudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views10 pages

Table Progam

The document contains multiple C programs that implement a simple calculator with various functionalities, including addition, subtraction, multiplication, division, exponentiation, and generating multiplication tables. Each program prompts the user for input and performs calculations based on the selected operation. Additionally, one program includes functionality to solve quadratic equations.

Uploaded by

harshyudi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

// Online C compiler to run C program online

#include <stdio.h>
int c,a,i;
int main()
{
// Write C code here
printf("Enter the number of which table you want to find = ");
scanf("%d",&a);
for(i=0;i<11;i++)
{
c=a*i;
printf("\n%d",a);
printf(" x ");
printf("%d",i);
printf(" = %d",c);
}
return 0;
}

https://www.programiz.com/online-compiler/3qbo0TY1w50HA

#include <stdio.h>
#include <math.h>
int d,i;
double j,u,w,a,b,c,e,f,g,h,s,k,l,x,n,result,o,p,z;
int main()
{
// Write C code here
printf(" My calculator");
printf("\n***********************");
printf("\nEnter:");
printf("\nEight for finding a+b");
printf("\nSeven for finding a-b");
printf("\nNine for finding a*b");
printf("\nEleven for finding a/b");
printf("\nSix for finding a^b");
printf("\nFive for finding table of a number");
printf("\n***********************");
printf("\nEnter = ");
scanf("%d",&d);
printf("\n***********************");
if(d==8)
{
goto mm;
}
if(d==7)
{
goto nn;
}
if(d==9)
{
goto rr;
}
if(d==11)
{
goto ee;
}
if(d==6)
{
goto tt;
}
if(d==5)
{
goto yy;
}
mm:
printf("\nThe sum of two number");
printf("\nEnter the first number = ");
scanf("%lf",&a);
printf("\nEnter the second number=");
scanf("%lf",&b);
c=a+b;
printf("\n%lf + %lf =%lf",a,b,c);
return 0;
nn:
printf("\nThe difference between the two number" );
printf("\nEnter the first number = ");
scanf("%lf",&h);
printf("\nEnter the second number=");
scanf("%lf",&g);
f=h-g;
printf("\n%lf - %lf =%lf",h,g,f);
return 0;
rr:
printf("\nThe product of two number");
printf("\nEnter the first number = ");
scanf("%lf",&s);
printf("\nEnter the second number=");
scanf("%lf",&l);
k=s*l;
printf("\n%lf * %lf =%lf",s,l,k);
return 0;
ee:
printf("\nThe quotient of two number");
printf("\nEnter the first number = ");
scanf("%lf",&u);
printf("\nEnter the second number=");
scanf("%lf",&w);
j=u/w;
printf("\n%lf / %lf =%lf",u,w,j);
return 0;
tt:
printf("\nTo find a^b");
printf("\nEnter the value of base: ");
scanf("%lf",&x);
printf("\nEnter the value of power: ");
scanf("%lf",&n);
result =pow(x,n);
printf("%lf ^ %lf =%lf" ,x,n,result);
return 0;
yy:
printf("\nEnter the number of which table you want to find = ");
scanf("%lf",&o);
for(i=0;i<11;i++)
{
p=o*i;
printf("\n%lf",o);
printf(" x ");
printf("%d",i);
printf(" = %lf",p);
}
return 0;
}

https://www.programiz.com/online-compiler/6oVfdb3glErL6

// Online C compiler to run C program online


#include <stdio.h>
#include <math.h>
int d,i,num;
double j,u,w,a,b,c,e,f,g,h,s,k,l,x,n,result,o,p,z,D;
int main()
{
// Write C code here
printf(" My calculator");
printf("\n***********************");
printf("\nEnter:");
printf("\nEight for finding a+b");
printf("\nSeven for finding a-b");
printf("\nNine for finding a*b");
printf("\nEleven for finding a/b");
printf("\nSix for finding a^b");
printf("\nFive for finding table of a number");
printf("\n***********************");
printf("\nEnter = ");
scanf("%d",&d);
printf("\n***********************");
if(d==8)
{
goto mm;
}
if(d==7)
{
goto nn;
}
if(d==9)
{
goto rr;
}
if(d==11)
{
goto ee;
}
if(d==6)
{
goto tt;
}
if(d==5)
{
goto yy;
}
mm:
printf("\n***********************");
printf("\nEnter:");
printf("\nTwo for finding the sum of two numbers");
printf("\nThree for finding the sum of three numbers");
printf("\nFour for finding the sum of four numbers");
printf("\n***********************");
printf("\nEnter = ");
scanf("%d",&num);
if(num==2)
{
goto gg;
}
if(num==3)
{
goto WW;
}
gg:
printf("\nThe sum of two number");
printf("\nEnter the first number = ");
scanf("%lf",&a);
printf("\nEnter the second number=");
scanf("%lf",&b);
c=a+b;
printf("\n%lf + %lf =%lf",a,b,c);
return 0;
WW:
printf("\nThe sum of three number");
printf("\nEnter the first number = ");
scanf("%lf",&a);
printf("\nEnter the second number=");
scanf("%lf",&b);
printf("\nEnter the third number=");
scanf("%lf",&D);
c=a+b+D;
printf("\n%lf + %lf + %lf =%lf",a,b,D,c);
return 0;
nn:
printf("\nThe difference between the two number" );
printf("\nEnter the first number = ");
scanf("%lf",&h);
printf("\nEnter the second number=");
scanf("%lf",&g);
f=h-g;
printf("\n%lf - %lf =%lf",h,g,f);
return 0;
rr:
printf("\nThe product of two number");
printf("\nEnter the first number = ");
scanf("%lf",&s);
printf("\nEnter the second number=");
scanf("%lf",&l);
k=s*l;
printf("\n%lf * %lf =%lf",s,l,k);
return 0;
ee:
printf("\nThe quotient of two number");
printf("\nEnter the first number = ");
scanf("%lf",&u);
printf("\nEnter the second number=");
scanf("%lf",&w);
j=u/w;
printf("\n%lf / %lf =%lf",u,w,j);
return 0;
tt:
printf("\nTo find a^b");
printf("\nEnter the value of base: ");
scanf("%lf",&x);
printf("\nEnter the value of power: ");
scanf("%lf",&n);
result =pow(x,n);
printf("%lf ^ %lf =%lf" ,x,n,result);
return 0;
yy:
printf("\nEnter the number of which table you want to find = ");
scanf("%lf",&o);
for(i=0;i<11;i++)
{
p=o*i;
printf("\n%lf",o);
printf(" x ");
printf("%d",i);
printf(" = %lf",p);
}
return 0;
}
https://www.programiz.com/online-compiler/993r6aHMaiRp1

// Write C code here


printf(" My calculator ");

printf("\n\n***********************");
printf("\nEnter: cccccccccccc");
printf("\nEight for finding a+b cccccccccccccccccc");
printf("\nSeven for finding a-b cccccccccccccccccccccccccc");
printf("\nNine for finding a*b cccccccccccc ccccccccc");
printf("\nEleven for finding a/b. cccccccc");
printf("\nSix for finding a^b cccccccc");
printf("\nFour for finding the value of x from a quadratic equation cccccccccccc \
tccccccccc");
printf("\nFive for finding table of a number cccccccccccccccccccccccccc");
printf("\n*********************** cccccccccccccccccc ");
printf("\n cccccccccccc ");
printf("\nEnter = ");
scanf("%d",&d);
printf("\n***********************");
if(d==8)
{
goto mm;
}
if(d==7)
{
goto nn;
}
if(d==9)
{
goto rr;
}
if(d==11)
{
goto ee;
}
if(d==6)
{
goto tt;
}
if(d==5)
{
goto yy;
} if(d==4)
{
goto NN;
}
mm:
printf("\n***********************");
printf("\nEnter:");
printf("\nTwo for finding the sum of two numbers");
printf("\nThree for finding the sum of three numbers");
printf("\nFour for finding the sum of four numbers");
printf("\n***********************");
printf("\nEnter = ");
scanf("%d",&num);
if(num==2)
{
goto gg;
}
if(num==3)
{
goto WW;
}
gg:
printf("\nThe sum of two number");
printf("\nEnter the first number = ");
scanf("%lf",&a);
printf("\nEnter the second number=");
scanf("%lf",&b);
c=a+b;
printf("\n%lf + %lf =%lf",a,b,c);
return 0;
WW:
printf("\nThe sum of three number");
printf("\nEnter the first number = ");
scanf("%lf",&a);
printf("\nEnter the second number=");
scanf("%lf",&b);
printf("\nEnter the third number=");
scanf("%lf",&D);
c=a+b+D;
printf("\n%lf + %lf + %lf =%lf",a,b,D,c);
return 0;
nn:
printf("\nThe difference between the two number" );
printf("\nEnter the first number = ");
scanf("%lf",&h);
printf("\nEnter the second number=");
scanf("%lf",&g);
f=h-g;
printf("\n%lf - %lf =%lf",h,g,f);
return 0;
rr:
printf("\nThe product of two number");
printf("\nEnter the first number = ");
scanf("%lf",&s);
printf("\nEnter the second number=");
scanf("%lf",&l);
k=s*l;
printf("\n%lf * %lf =%lf",s,l,k);
return 0;
ee:
printf("\nThe quotient of two number");
printf("\nEnter the first number = ");
scanf("%lf",&u);
printf("\nEnter the second number=");
scanf("%lf",&w);
j=u/w;
printf("\n%lf / %lf =%lf",u,w,j);
return 0;
tt:
printf("\nTo find a^b");
printf("\nEnter the value of base: ");
scanf("%lf",&x);
printf("\nEnter the value of power: ");
scanf("%lf",&n);
result =pow(x,n);
printf("%lf ^ %lf =%lf" ,x,n,result);
return 0;
yy:
printf("\nEnter the number of which table you want to find = ");
scanf("%lf",&o);
for(i=0;i<11;i++)
{
p=o*i;
printf("\n%lf",o);
printf(" x ");
printf("%d",i);
printf(" = %lf",p);
}
return 0;
NN:
printf("\nQuadratic Equation");
printf("\nIf ax^2 + bx + c = 0");
printf("\nEnter the value of a = ");
scanf("%lf",&A);
printf("\nEnter the value of b = ");
scanf("%lf",&B);
printf("\nEnter the value of c = ");
scanf("%lf",&C);
printf("\n***********************");
printf("\nx=[-b+√(b^2-4ac)]/2a\tor\tx=[-b-√(b^2-4ac)]/2a");
printf("\n***********************");
G=B;
B=G*-1;
Y=B*-1;

printf("\nx=[%lf+√(%lf^2-4X%lfX%lf)]/2X%lf\nor \nx=[%lf-√(%lf^2-4X%lfX%lf)]/2X
%lf",B,Y,A,C,A,B,Y,A,C,A);
printf("\n***********************");
E=pow(B,2)-4*A*C;
printf("\nx=[%lf+√(%lf)]/2X%lf\nor \nx=[%lf-√(%lf)]/2X%lf",B,E,A,B,E,A);
printf("\n***********************");
F=2*A;
printf("\nx=[%lf+√(%lf)]/%lf\nor \nx=[%lf-√(%lf)]/%lf",B,E,F,B,E,F);
printf("\n***********************");
T=sqrt(E);
printf("\nx=[%lf+%lf]/%lf\nor \nx=[%lf-%lf]/%lf",B,T,F,B,T,F);
printf("\n***********************");
H=B+T;
K=B-T;
printf("\nx=[%lf]/%lf\nor \nx=[%lf]/%lf",H,F,K,F);
printf("\n***********************");
J=H/F;
L=K/F;
printf("\nx=%lf\nor \nx=%lf",J,L);
return 0;
}

https://www.programiz.com/online-compiler/0apOBsq93eUWz
https://www.programiz.com/online-compiler/0vC7iBGjuaCBo

https://www.programiz.com/online-compiler/6c2teekR2gCPL

You might also like