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

hyhuynh@sleet:- hyhuynh@sleet:- [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet

ID: 3761904 • Letter: H

Question

hyhuynh@sleet:- hyhuynh@sleet:- [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet1s [hyhuynh@sleet s cc Assignment5.c1m Assignment5.c: In function 'main' Assignment5.c:25: error: expected expression before 'int Assignment5.c:25: error: expected expression before 'int Assignment5.c:25: error: too few arguments to function 'function2' Assignment5.c: At top level: Assignment 5 . c : 33: error : expected identifier or 1(, before , token hyhuynhesleet GNU nano 2.0.9 File: Assignment5.c Modified | include # include int fucntionl (int x, int n)t (pow (x, n)) *sin (x) int function2 (int x, int n) t (pow (x, 2)) (sqrt (n)) suint main (void) int n, , i; float E printf ("enter the value of n "); scanf ("%d", &n;); printf ("enter the valur of x ") scanf ("%d", &x;); for (1=0; 1

Explanation / Answer

#include<stdio.h>
#include<math.h>
double function1(int x,int n){ // this function will return decimal values
return pow(x,n)*sin(x);
}
double function2(int x,int n){ // this function will return decimal values
return pow(x,2)+sqrt(n);
}

int main()
{
int n,x,i;
double F;
printf("Enter the value of n ");
scanf("%d",&n);
printf("Enter the value of x ");
scanf("%d",&x);
for(i = n;i > 0;i--){ // repeating process till n is positive
printf("n = %d,x = %d",i,x); // displaying n,x
F = function1(x,i)/function2(x,i);
printf(",F = %lf ",F);//displaying Function F
}

return 0;
}