Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

PROGRAM TO DISPLAY VALUE OF Y USING Y = EXP(-X) FOR VALUE OF X FROM 0.0 TO 0.9

Posted By: Binge Fischer     Category: C Programming     Views: 2458

WRITE A PROGRAM TO DISPLAY VALUE OF Y USING Y = EXP(-X) FOR VALUE OF X FROM 0.0 TO 0.9

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

*/
  
Share: 



Binge Fischer
Binge Fischer author of PROGRAM TO DISPLAY VALUE OF Y USING Y = EXP(-X) FOR VALUE OF X FROM 0.0 TO 0.9 is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!