Q1Write A C Program To Find Roots of A Quadratic Equation. Program Coding
Q1Write A C Program To Find Roots of A Quadratic Equation. Program Coding
Program coding
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float x,y,temp1,temp2,temp3;
clrscr();
printf("Enter the variables x and y\n");
scanf("%f%f",&x,&y);
temp1=(x+3)*pow(x,3);
temp2=(y-4)*(y+5);
temp3=temp1/temp2;
printf("The value of expression is %f\n",temp3);
getch();
}
Output
Output
(B)
2𝑣 + 6.22(𝑐 + 𝑑)
𝑅=
𝑔+𝑣
Program Coding
#include<stdio.h>
#include<math.h>
#include<conio.h>
void main()
{
float v,c,d,g,temp1,temp2,final;
clrscr();
printf("Enter the values\n");
scanf("%f%f%f%f%f",&v,&c,&d,&g,&v);
temp1=2*v+6.22*(c+d);
temp2=g+v;
final=temp1/temp2;
printf("The final answer is %f\n",final);
getch();
}
Output
C)
7.7𝑏(𝑥𝑦 + 𝑎)
− 0.8 + 2𝑏
𝐴= 𝑐
1
(𝑥 + 𝑎)( )
𝑦
Program Coding
#include<stdio.h>
#include<conio.h>
void main()
{
float x,y,a,b,c,t1,t2,t3,t4,t5,final;
clrscr();
Output
Q3) Write a program to receive Cartesian co-ordinates (x,y) of a point and
convert them into polar co-ordinates(r,ⱷ).
𝑦
Hint: 𝑟 = 𝑠𝑞𝑟𝑡(𝑥 2 + 𝑦 2 )𝑎𝑛𝑑 𝜑 = tan−1 ⁄𝑥
Program coding
#include<stdio.h>
#include<math.h>
#include<conio.h>
void main()
{
float x,y,z,j,polx,poly;
clrscr();
printf("Enter the coordinates\n");
scanf("%f%f",&x,&y);
j=y/x;
x=x*x;
y=y*y;
z=x+y;
polx=sqrt(z);
poly=atan(j);
printf("The Polar form is %f%f\n",polx,poly);
getch();
}
Output