luc035.c ​
Metadata ​
- Author — Amit Dutta (amitdutta4255@gmail.com)
- Last updated — 12 Dec 2025
- License — MIT
Problem Statement ​
Problem Statement
According to a study, the approximate level of intelligence of a person can be calculated using the following formula. i = 2 + (y + 0.5x) write a program that will produce a table of values of i, y and x, where y varies from 1 to 6, and, for each value of y, x varies from 5.5 to 12.5 in steps of 0.5
Source Code ​
Printing the code
To print this file, open it on GitHub and click Raw before printing, or use the Download Raw button above and print directly from that page.
c
#include <stdio.h>
int main()
{
double y, x;
printf("\n--- Approximate Intelligence ---\n");
for (y = 1; y <= 6; y++)
{
printf("\tY = %d\n", y);
for (x = 5.5; x <= 12.5; x += 0.5)
{
printf("Y: %g\t X: %.2g\t I: %g\n", y, x, 2 + (y + 0.5 * x));
}
printf("-----------------------\n");
}
return 0;
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16