Question

Write a program that receives two input values: a float number x=0, and an integer N>3. The program should output Y, which is
i need this program in DEV C and starts with include stdio.h only
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here Iam providing the code and the output for the given problem

Code

#include <stdio.h> int main() float x,result=1; //declaring the variables int N; while(true){ // Loop until x is greater than

for(int i = 1; i <= N ; i++) result - result * ix; //product of all numbers divivded by zi printf(%.2f,result);

Sample Output

Enter a float number : -1.3 Enter a float number : 2.3 Enter a number : 5 1.86

Sample Output

Enter a float number : 3.7 Enter a number : -1 Enter a number : 7 0.53

Sample Output

Enter a float number : 3.2 Enter a number : 7 1.47

Code

#include <stdio.h>
int main()
{
float x,result=1; //declaring the variables
  
int N;
  
while(true){ //loop until x is greater than 0
  
printf("Enter a float number : "); //taking input from user x
  
scanf("%f",&x);
  
if(x > 0) //if x is greater than 0 then we break the loop
break;
  
}
  
  
while(true){ //loop until N is greater than 3
  
printf("Enter a number : ");
  
scanf("%d",&N); //taking input from user
  
if(N > 3)
break;
  
  
}
  
for(int i = 1 ; i <= N ; i++)
result = result * i/x ; //product of all numbers divivded by z
  
printf("%.2f",result);
  
}

Add a comment
Know the answer?
Add Answer to:
i need this program in DEV C and starts with include stdio.h only Write a program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1 Rewrite the following program so that it will use function. include <stdio.h> Int main) printf...

    1 Rewrite the following program so that it will use function. include <stdio.h> Int main) printf ("Hello!") return 0 2 Assume a program has the following declarations: short s- 4 int i--5; long m-3 float f-19.3f; double d-3.6; What are the following values? (a) s+m (b) (float) d (c) d s (e) (int) f 3 What will be the output of the following program: int x = 3 float a 2.76; y-2* x; print f("X-2d, y*ta, z»%d", x, y, z);...

  • 9. Which of the following is true for the following program? #include <stdio.h> int maino int...

    9. Which of the following is true for the following program? #include <stdio.h> int maino int i = 1; switch (0) case 1: printf("%d", 0); case 2: printf("%d", 0); case 3: printf("%d", 0); default: printf("%d", 1); return 0; } (2 points) The program has no error, the output is 1111 The program has no error, the output is 1 The program produces a compile time error, because there are no break statements The program produces a compile time error, because...

  • C linux please write it by only using “if and else” conditions, thanks so much this...

    C linux please write it by only using “if and else” conditions, thanks so much this is my task 3 Requirements 1. Copy your solution for Task 3 t3.c to a new file t4.c. 2. The input is guaranteed to contain at least one non-whitespace character. 3. If the input is well-formed, i.e., can be parsed to a number, the program should behave identically to Task 3. All the requirements of Task 3 still apply except the file name. 4....

  • Please do in C and only use stdio.h. Write a program that reads n integers into...

    Please do in C and only use stdio.h. Write a program that reads n integers into an array, then prints on a separate line the value of each distinct element along with the number of times it occurs. The values should be printed in ascending order. Turn in your code and input/result together. Suppose, for example, that you input the values -7 3 3 -7 5 5 3 as the elements of your array. Then your program should print -7...

  • I really need help with this python programming assignment Program Requirements For part 2, i need...

    I really need help with this python programming assignment Program Requirements For part 2, i need the following functions • get floats(): It take a single integer argument and returns a list of floats. where it was something like this def get_floats(n):   lst = []   for i in range(1,n+1):     val = float(input('Enter float '+str(i)+': '))     lst.append(val)   return lst • summer(): This non-void function takes a single list argument, and returns the sum of the list. However, it does not use...

  • Please mad in dev c++ software That is example. But it is wrong Write a simple...

    Please mad in dev c++ software That is example. But it is wrong Write a simple checkbook balancing program Input will contain either the word "withdraw" or "deposit". The next line will contain the amount of the check or deposit. After reading each pair of lines, the program should compute and print the new balance. You can declare the variable to hold the running balance to be type float, and you can use the function atof (also in the standard...

  • CProgramming using Dev C ++ #include <stdio.h> PLEASE NO math.h Corporate Sales Data Report Write a...

    CProgramming using Dev C ++ #include <stdio.h> PLEASE NO math.h Corporate Sales Data Report Write a program that read creates a structure for a company's divisions. The structure should have: Division name (North, South, East, West, and Central) Quarter (1, 2, 3, or 4) Quarterly sales · Your job is to write a program that will create a two-dimensional array of 5 rows (divisions) and 4 columns (quarters). The program should ask the user to enter in all four quarters...

  • 22. (6 points) Determine the output for the following coe # include < stdio.h > int...

    22. (6 points) Determine the output for the following coe # include < stdio.h > int main(void) ( int z 1, total -0, y printf(d , x) ) //end-for printf("The total %d\n", total) ) //end-main

  • Need help in C (a) Write a C program to read in a line of text...

    Need help in C (a) Write a C program to read in a line of text and count the occurrence of each English alphabet. The lowercase version of a letter is considered the same as the uppercase. To make viewing easy, the frequencies should be presented using a bar chart as follows. You can assume that the input contains only spaces, lowercase letters, uppercase letters and the newline character (i.e. the Enter key). Enter a line of text: Letter ZZz...

  • QUESTIONS What will be the output of the following C code? 1. #include <stdio.h> int maino...

    QUESTIONS What will be the output of the following C code? 1. #include <stdio.h> int maino int 1 - -3; int k - * % 2; printf(\n", k); Compile time error O-1 Implementation defined

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT