Convert following flowchart in to C++ Code (logic explained step by step)


Here is the post   to convert following flowchart in to C++ Code .  Here is the algorithm.

  Steps
User side
1: User asked to enter temperature.
2: Screen displays the result.
Developer side
1: Declare variables that are going to be used in program .
2: Input the temperature from user.
3: Check if the temperature is less than 32 then declare the temperature as below freezing.
4: If the above condition stands false print Above freezing.
5: Program ends here.
Code:

#include <iostream>
using namespace std;
int main()
{   int temp;
    cout<<"Enter tempature";
    cin>>temp;
    if(temp<32)
    {cout<<"Below Freezing"<<endl;}
    else cout<<"Above Freezing"<<endl;
   system("pause");
   return 0;
}

Output:

Comments