Code for PROGRAM TO DISPLAY VALUE OF Y USING Y = EXP(-X) FOR VALUE OF X FROM 0.0 TO 0.9 in C Programming
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float i,j;
clrscr();
for(j=0;j<=9;j++)
{
printf("\n");
for(i=0 ; i<=1; i = i + 0.1)
{
if(j==0)
printf("%2.1f|",i);
elseif (i==0)
printf("%2.1f|",j);
elseif (i!=0 && j !=0)
printf("%3.1f|",exp(-i));
}
}
getch();
}
/*
**********
OUTPUT
**********
Enter the number of persons :: 6
Enter age of 1 persons :: 10
Enter age of 2 persons :: 20
Enter age of 3 persons :: 30
Enter age of 4 persons :: 55
Enter age of 5 persons :: 51
Enter age of 6 persons :: 56
Number of persons whose age between 50-60 are :: 3
*/