C Programming Blog

 
 
 
#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);
            else if (i==0)
               printf(\"%2.1f|\",j);
            else if (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

*/

 
 
Didn't find what you were looking for? Find more on PROGRAM TO DISPLAY VALUE OF Y USING Y = EXP(-X) FOR VALUE OF X FROM 0.0 TO 0.9