1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kirill115 [55]
3 years ago
13

Write a few statements that open a file called "greeting", write the message "hey!" to the file -- and then close it. declare an

y variables needed.
Computers and Technology
2 answers:
pshichka [43]3 years ago
6 0
C++:

int main () {

std::ofstream output {"greeting.txt"};
output << "hey!";
output.close();

return 0;
}
Shtirlitz [24]3 years ago
5 0

Answer:

The answer to this question can be given as:

Statement:

FILE *data1;     //create file pointer type variable

data1 = fopen("greeting","w");    //open file use fopen function

fprintf(data1,"hey!");    //print message.

fclose(data1);  //close file.

Explanation:

The description of the statement can be given as:

  • In this statement firstly we define a file pointer type variable that is "data1".This variable holds the file.  
  • Then we use the fopen() function that is used to open a file. In this function, we pass the file name and the mode to open the file.
  • Then we use the fprintf() function this function prints the value of the file.
  • In the last, we close the file, for close file we use fclose() function.
You might be interested in
Which tool is used to create an interactive web application?
tangare [24]

Answer:

JavaScript is the correct answer

Explanation:

HTML help creates the structural overview, CSS helps in the design and an application software helps in the accessibility, editing, typing of code, but JavaScript helps to make it interactive. Thank you.

7 0
4 years ago
Andrew has data in cell E14 and the cell should be blank. Andrew should _____.
denpristay [2]
Use the mouse to click on cell E14 and press delete
4 0
4 years ago
Read 2 more answers
What is the output of the given code?<br><br> A. Compiler error<br> B. 0505<br> C. Smooth<br> D. 0.0
oksano4ka [1.4K]

Answer:

The answer is A. Compile error

Explanation:

In the class Fabric, fabricID has private access. You can only print out out private variables in the class or function they are assigned in.

ps: sorry if I am wrong, I am kind of new to java

6 0
3 years ago
Ask what kind of pet the user has. If they enter cat, print "Too bad...", if they enter dog, print "Lucky you!" (You can change
nirvana33 [79]

Answer:

Explanation:

a = input("what kind of pet the user has")

if a == 'cat':

  print("Too bad")

elif a == 'dog':

   print("Lucky you!")

8 0
3 years ago
TRUE/FALSE<br><br> The Interrupt Flag (IF) controls the way the CPU responds to all interrupts.
Nastasia [14]

Answer: True.

Explanation:

The value of the IF is very important to respond to the interrupts in the OS. It is a system flag bit. All the hardware interrupts will be handled if the flag value is set to 1 else all interrupts will be ignored. It takes two values either 1 or 0.

3 0
4 years ago
Other questions:
  • most dialog boxes in windows programs requiring navigation follow a similar procedure. true or false.
    7·1 answer
  • A pizza cutter is a compound machine made up of what simple machines?
    7·1 answer
  • Which is the correct sequence of steps for opening a new document?
    10·2 answers
  • In which network zone should a web server be placed?
    14·1 answer
  • 2 The software needed to send an email is:
    7·1 answer
  • Click/press _______ to remove the most recently typed text.
    12·2 answers
  • Does technology shape society or does society shape technology?
    14·1 answer
  • The captured images are stored as digital photo files on camera. Explain how the captured images are converted to digital photo
    6·1 answer
  • Cute nya diba I like bts army​
    10·1 answer
  • Which sql keyword is used to retrieve a minimum value from an attribute in a table
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!