Logo 
Search:

C Programming Articles

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

Program to draw reliability graph

Posted By: Bethany Hughes     Category: C Programming     Views: 4078

Write a program to draw reliability graph.

Code for Program to draw reliability graph in C Programming

   #include <math.h>                                           
   #define  LAMDA   0.001                                      
   main()                                                      
   {   
  double t;                                               
       float r;                                                
       int  i, R;                                              
       for (i=1; i<=27; ++i) 
       {
printf("--");
       }                                                       
       printf("\n");                                           
       for (t=0; t<=3000; t+=150)                              
       { 
r = exp(-LAMDA*t);                                  
           R = (int)(50*r+0.5);                                
           printf(" |");                                       
           for (i=1; i<=R; ++i)
           {
   printf("*");                                    
           }     
                                              
           printf("#\n");                                      
       }  
       for (i=1; i<3; ++i)  
       {
printf(" |\n"); 
       } 
                                                      
   }  
                                                         
 

Output                                                      
    -----------------------------------------------------      
    |**************************************************#       
    |*******************************************#              
    |*************************************#                    
    |********************************#                         
    |***************************#                           
    |************************#                                 
    |********************#                                     
    |*****************#                                        
    |***************#                                          
    |*************#                                          
    |***********#                                              
    |**********#                                               
    |********#                                                 
    |*******#                                                  
    |******#                                                   
    |*****#                                                    
    |*****#                                                    
    |****#                                                     
    |***#                                                      
    |***#                                                      
    |**#                                                       
  
Share: 


Didn't find what you were looking for? Find more on Program to draw reliability graph Or get search suggestion and latest updates.

Bethany Hughes
Bethany Hughes author of Program to draw reliability graph is from London, United Kingdom.
 
View All Articles

 
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!