Question

In: Computer Science

how to implement h / k sqrt(n) in c h being a constant k being the...

how to implement h / k sqrt(n) in c
h being a constant
k being the students k(k < 10^9)
n is the two mid points in a ternary search

in c programing

Solutions

Expert Solution

#include <stdio.h>
#include <math.h>

int main()
{
//variable declaration
long int k;
long double h,n, result;
  
//input constant value
printf("Enter the constant value(h): ");
scanf("%Lf", &h);
  
//input total number of student
printf("Enter the number of students(k): ");
scanf("%ld", &k);
  
//input mid point value
printf("Enter the midpoint value(n): ");
scanf("%Lf", &n);
  
//calculate the expression value
result = h / (k * sqrt(n));
  
//display result
printf("\nResult = %Lf", result);

return 0;
}


INPUT:

Enter the constant value(h): 999999999                                                                                        

Enter the number of students(k): 1000000000                                                                                    

Enter the midpoint value(n): 10  

                                                                                            

OUTPUT:   

Result = 0.316228


Related Solutions

how to implement h / k sqrt (n) in c programing
how to implement h / k sqrt (n) in c programing
lace the points of the line either on N and K or on N and H.
10. Price elasticity of supply in the short run and long run The following graph shows the short-run supply curve for pears. Place the orange  (square symbol) on the following graph to show the most likely long-run supply curve for pears. (Note: Place the points of the line either on N and K or on N and H. )
Leave your answers as P(n, k), C(n, k) How many solutions are there to the following...
Leave your answers as P(n, k), C(n, k) How many solutions are there to the following equation, if a, b, c, d, e are all non-negative integers? a + b + c + d + e = 37 How many solutions are there to the previous equation, if a ≥ 4, and 2 ≤ d ≤ 4 ?
How to convolve x[n] and h[n] in code composer studio using c . Also tell the...
How to convolve x[n] and h[n] in code composer studio using c . Also tell the steps to see the graph of convolved signal in ccs without connecting any hardware DSPKit
for (i=0; i<n; i++) for (j=1; j<n; j=j*2)    for (k=0; k<j; k++) ... // Constant...
for (i=0; i<n; i++) for (j=1; j<n; j=j*2)    for (k=0; k<j; k++) ... // Constant time operations end for end for end for Analyze the following code and provide a "Big-O" estimate of its running time in terms of n. Explain your analysis. Note: Credit will not be given only for answers - show all your work: (2 points) steps you took to get your answer. (1 point) your answer.
Treatment of a polypeptide with Tris-(2-carboxyethyl)-phosphine hydrochloride (TCEP) yields two peptides: 1. I-Q-K-H-C-R-C-A-K-M-V-S 2. F-C-R-L-K-D-C-K-N-D Treatment...
Treatment of a polypeptide with Tris-(2-carboxyethyl)-phosphine hydrochloride (TCEP) yields two peptides: 1. I-Q-K-H-C-R-C-A-K-M-V-S 2. F-C-R-L-K-D-C-K-N-D Treatment of the intact polypeptide with Trypsin yields fragments with the following amino acid composition: (Ser, Met, Val) (Lys, Gln, Ile) (Phe, Ala, Cys2, Arg, Lys) (Asp, Asn) (Leu, Lys) (Lys, His, Asp, Cys2, Arg) a) The intact (untouched) polypeptide is labeled with 1-Fluoro-2,4-dinitrobenzene (FDNB) labeling, followed by acid hydrolysis. What will be observed? b) Name and briefly describe a method which may determine if...
Constant returns to scale implies that if N and K both increase by 3% that
  2. Constant returns to scale implies that if N and K both increase by 3% that       A) Output (Y) will increase by 3%.     B) Y/N will increase by 3%.     C) Y/N will increase by less than 3%.     D) the capital-labor ratio will increase by 3%. 4. Which of the following statements is always true?       A) Investment equals depreciation.     B) Investment equals the capital stock minus...
Let G, H, K be groups. Prove that if G ≅ H and H ≅ K...
Let G, H, K be groups. Prove that if G ≅ H and H ≅ K then G ≅ K.
Show that the set of all real numbers of the form a+b sqrt(2)+c sqrt(3)+d sqrt(6),where a,b,c,d...
Show that the set of all real numbers of the form a+b sqrt(2)+c sqrt(3)+d sqrt(6),where a,b,c,d ∈Q, forms a subfield of R
Let S_k(n) = 1^k + 2^k + ··· + n^k for n, k ≥ 1. Then,...
Let S_k(n) = 1^k + 2^k + ··· + n^k for n, k ≥ 1. Then, S_4(n) is given by S_4(n)= n(n+1)(2n+1)(3n^2 +3n−1)/ 30 Prove by mathematical induction.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT