Exercise[6B(b),LET US C SOLUTION

0 min read

 Exercise[6B(b)]

According to a study,the approximate level of intelligence of 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.   */
#include<stdio.h>
int main()
{
	int y;
	// y is integer varies from 1 to 6.
	float i,x;
	printf("i\t y\t x\n");
	for(y=1;y<=6;y++)
	{
		for(x=5.5;x<=12.5;x=x+0.5)
		{
			// formula for intelligence
			i=2+(y+0.5*x);
			printf("%2f\t %d\t.2f\n",x,y,x);
		}
	}
	return 0;
}
Welcome to prgrmramit.blogspot.com! I'm Amit Singh, an expert in AI, Data Science, and Machine Learning. I created this blog to share practical insights and tips for those eager to learn and gro…

You may like these posts

  •  Exercise[6B(h)]Write a program to print 24 hours of day with suitable suffixes like AM,PM,Noon and Midnight. */ #include<stdio.h> int main() { int h; for(h…
  •  Exercise[6B(f)]Population of a town today is 100000.The population hd increased steadily at the rate of 10% per year for last 10 years.Write a program to determine the popu…
  •  Exercise[6B(c)]When interest compunds q times per year at an annual rate of r% for n years,the principle p compounds to an amount a as per the following formula a=p(1+r/q)^nq…
  •  Exercise[6B(d)]The natural logarithm can be approximated by the following series. x-1/x+1/2(x-1/x)^2+1/2(x-1/x)^3+1/2(x-1/x)^4+... If x is input through the keyboard,write a …
  •  Exercise[6B(e)]Write a program to generate all Pythagorean Triplets with side length less than or equal to 30. */ #include<stdio.h> #include<math.h> int…
  •  Exercise[6B(g)]Ramanujan number is the smallest number that can be expressed as sum of two cubes in two different ways.Write a program to print all such numbers up to a re…

Post a Comment

Subscribe with Gmail


Premium By Raushan Design