Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  main 2.2
Language: C/C++
Code:

#include <stdio.h>

int main()
{
    double altitude = 500;
    double velocity = 50;
    double fuelRemaining = 120;
    
    
    for(int i = altitude ; i >= 0 ; i -= velocity )
    {
    printf("Velocity is: %lf feet per second\n",velocity);
    printf("Altitude is: %lf feet\n",altitude);
    if(fuelRemaining > 0)
    printf("Fuel Remaining is: %lf \n?\n",fuelRemaining);
    else
    printf("Fuel Remaining is: 0 \n");
    
    fuelRemaining -= 30;
    altitude -= 50;
        
    }
    
    
    
    return 0;
}
Comments: