0

I have this simple program named Conversion.cc on my Desktop &.show below

//
// Conversion - Program to convert temperature from
//            Celsius into Fahrenheit:
//            Fahrenheit = Celsius * (212 -32)/100 +32
//
#include <studio>

#include <cstdlib>
#include <iostream>
using namespace std;

int main(int nNumberofArgs, char* pszArgs[]){
 {                                              
   // enter the temperature in Celsius
  int celsius
  cout << "Enter the temperature In Celsius:";
  cin >> celsius;
  
  calculate conversion factor for Celsius
  // to Fahrenheit
  int factor;
  factor = 212 - 32;
  
  // use conversion factor to convert Celsius
  // into Fahrenheit values 
  int fahrenheit;
  fahrenheit = factor * celsius/100 +32:
 
 //output the results (followed by a Newline)
  cout << fahrenheit value is:";
  cout << fahrenheit << end];
  
  //wait until user is ready before terminating program
  //to allow the user to see program results
  system("PAUSE");
  return 0;
  }  

I went to use g++ to compile it. the results are shown below

Desktop$ g++ -o Conversion Conversion.cc
Conversion.cc:6:10: fatal error: studio: No such file or directory
    6 | #include <studio>
      |          ^~~~~~~~
compilation terminated.

Desktop$ g++ -o Conversion Conversion.cc
Conversion.cc:6:10: fatal error: studio: No such file or directory
    6 | #include <studio>
      |          ^~~~~~~~
compilation terminated.
3
  • 5
    The C header file is named stdio.h and the C++ header is cstdio Jan 24, 2023 at 20:43
  • 2
    Make sure you actually specify the correct include. studio is not stdio and if you intend to import the stdio library then you need to spell it right. Also, FYI, pure programming questions like this probably belong on Stack Overflow, not here on Ask Ubuntu.
    – Thomas Ward
    Jan 24, 2023 at 20:54
  • ... I notice that your code doesn't appear to use any C-style IO functions, so you likely don't need cstdio anyhow Jan 24, 2023 at 21:42

0

You must log in to answer this question.

Browse other questions tagged .