C Saved Program: kind-dog

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


#include <stdio.h>
int main(void)
{
    float p, c=0.01, e=90, w, r=0;
int n = 0;


    printf("Enter value for w, r,n: ");
    scanf("%f %f %d" ,&w,&r,&n);

// for loop terminates when n is less than count
for(int i=1;i<n+1;i++)
{
       p=c*e*(w*r-1+w);
       e=e+p;
}
    printf("Final E = %f\n", e);

    return 0;
}
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs