Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3.28 Implement a program that requests four numbers (integer or floating-point)

ID: 3732883 • Letter: 3

Question

3.28 Implement a program that requests four numbers (integer or floating-point) from the user. Your program should compute the average of the first three numbers and compare the average to the fourth number. If they are equal, your program should print 'Equal' on the screen. >>> Enter first number: 4.5 Enter second number: 3 Enter third number: 3 Enter last number: 3.5 Equal 3.29 Implement a program that requests the user to enter the x and y coordinates (each between 10 and 10) of a dart and computes whether the dart has hit the dartboard, a circle with center (0,0) and radius 8. If so, string It is in! should be printed on the screen. >>> Enter x: 2.5 Enter y: 4 It is in!

Explanation / Answer

I am writing a code in c for 3.28

#include<stdio.h>

void main()

{

float no1,no2,no3,no4;

float ans;

printf(" Enter first number:");

scanf("%f",&no1);

printf(" Enter secondnumber:");

scanf("%f",&no2);

printf(" Enter third number:");

scanf("%f",&no3);

printf(" Enter lastnumber:");

scanf("%f",&no4);

ans=(no1+no2+no3)/3;

if(ans==no4)

printf(" Equal");

}

C code for 3.29

#include<stdio.h>

void main()

{

int x,y;

printf(" Enter x:");

scanf("%d",&x);

printf(" Enter y:");

scanf("%d",&y);

if(x<=8||y<=8 || x>=-8 ||y>=-8)

   printf(" It is in!");

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote