Anyone help me to output this float inside the loop? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Anyone help me to output this float inside the loop?

#include <stdio.h> #include <math.h> int main(){ float a, b, n, x, lrs; int i; printf("Function: 3x³ + 7x² + 1"); printf("\nEnter the value of b: "); scanf("%.0f", &b); printf("Enter the value of a: "); scanf("%.0f", &a); printf("Enter the value of n: "); scanf("%.0f", &n); x = (b - a)/n; printf("Interval: %.1f\n", x); printf("\nLRS = "); for (i = 1; i <= n; i++){ lrs = pow(a, 2) - 1 ; printf("%.1f", x); } return 0; }

9th Oct 2018, 1:41 PM
Kari Gakure
Kari Gakure - avatar
1 Answer
+ 1
Can you explain what this program is about? I don't understand what is the problem. Can you give me some sample values for a, b and n for me to test?
11th Oct 2018, 11:11 AM
Ipang