I need some help completing my program i commented what doesnt work #include <st
ID: 3660166 • Letter: I
Question
I need some help completing my program i commented what doesnt work
#include <stdio.h>
#include <math.h>
int main()
{
int x,count=0;
float a,sum=0,w,t,y=0;
printf("Enter value of x: ");
scanf("%d",&x);
while(x!=-1)
{
y=((x+3)(x+4))/2(x+1);//doesnt work
if(y>=1 || y<=10)
{
w=sqrt(y-1);//doesnt work
t=((1/7)w);//doesnt work
}
else
{
t=((y^3)+1)^4;//doesnt work
}
count++;
sum +=t;//how do i get the absolute value of t
printf("%d",t);//absolute value of t
printf("Enter value of x: ");
scanf("%d",&x);
}
a=sum/count;//average
printf("%d",&a);
return 0;
}
Explanation / Answer
#include #include //NOW ALL WORK...U just needed to assign the type of each variable above int main() { int x,count=0; float a,double sum=0,double w,double t,double y=0; printf("Enter value of x: "); scanf("%d",&x); while(x!=-1) { y=((x+3)(x+4))/2(x+1);//doesnt work if(y>=1 || yRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.