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
saw5 [17]
3 years ago
14

Write only in C, not C++.

Computers and Technology
1 answer:
yawa3891 [41]3 years ago
7 0

Answer:

#include <iostream>

using namespace std;

int main() {

  int k;

double d;

string s;

cin >> k >> d >> s;

cout << s << " " << d << " " << k << "\n" << k << " " << d << " " << s; }

                                                                   

Explanation:

k is int type variable that stores integer values.

d is double type variable that stores real number.

s is string type variable that stores word.

cin statement is used to take input from user. cin takes an integer, a real number and a word from user. The user first enters an integer value, then a real number and then a small word as input.

cout statement is used to display the output on the screen. cout displays the value of k, d and s which entered by user.

First the values of k, d and s are displayed in reverse order. This means the word is displayed first, then the real number and then the integer separated again by EXACTLY one space from each other. " " used to represent a single space.

Then next line \n is used to produce a new line.

So in the next line values of k, d and s are displayed in original order (the integer , the real, and the word), separated again by EXACTLY one space from each other.

The program along with the output is attached.

You might be interested in
Add the following method to the Point class: public double distance(Point other) Returns the distance between the current Point
GaryK [48]

Answer:

public class Point

{

  public int x;

  public int y;

  Point(int x,int y)

  {

      this.x=x;

      this.y=y;

  }

  public static void main(String[] args)

  {

      Point p1=new Point(-2,3);

      Point p2=new Point(3,-4);

      System.out.println("distance:"+distance(p1,p2));

 }

  private static double distance(Point p1,Point p2)

  {

      return Math.sqrt(Math.pow(p2.x-p1.x, 2)+Math.pow(p2.y-p1.y, 2));

  }

}

Explanation:

The java program defines the Point class and the public method 'distance' to return the total distance between the two quadrants passed to it as arguments (they are both instances of the Point class).

3 0
3 years ago
What are the benefits and drawbacks of a desktop utilising virtualisation and a server?
Sholpan [36]

•Cons of Virtualization. High Initial Investment. Data Can be at Risk. Quick Scalability is a Challenge. Performance Witnesses a Dip.

•Pros of Virtualization. Uses Hardware Efficiently. Available at all Times. Recovery is Easy. Quick and Easy Setup. Cloud Migration is Easier.

<h2>Mark as brainlest answer!!!!!</h2>
6 0
2 years ago
Write a statement that adds 1 to the variable reverseDrivers if the variable speed is less than 0,adds 1 to the variable parkedD
Elina [12.6K]

Answer:

if speed < 0:

 reverseDrivers +=1

elif speed < 1:

 parkedDrivers +=1

elif speed < 40:

 slowDrivers +=1

elif speed<=65:

 safeDrivers +=1

else:

 speeder +=1

Explanation:

The statements are written in python programming language

See a complete code screenshot attached, where all the variables are defined

8 0
3 years ago
I need a C++ program to ask the user to put in different numbers until zero is pressed then the program counts the numbers that
frozen [14]

Answer:

#include <iostream>

using namespace std;

int main()

{

int input = 0;

int count = 0;

int sum = 0;

int sumNegative = 0;

while (true) {

 cout << "Enter a number: ";

 cin >> input;

 if (input == 0) break;

 count++;

 sum += input;

 if (input < 0) {

  sumNegative += input;

 }

}

cout << "Count of the numbers: " << count << endl;

cout << "Sum of all the numbers: " << sum << endl;

cout << "Sum of the negative numbers: " << sumNegative << endl;

}

Explanation:

Your requirements regarding the sum and the negative numbers was a bit vague so I just did something you can probably adjust easily to your liking.

7 0
3 years ago
Some files appear dimmed in one of the default folders on your computer. What would be the best course of action? A. Leave the f
Zielflug [23.3K]
If some files appear dimmed in one of the default folders on your computer, the best course of action would be to A. leave the files as they are.
These files are probably either hidden or system files, which are never meant to be deleted or moved.
8 0
3 years ago
Other questions:
  • An Open Authorization (OAuth) access token would have a _____ that tells what the third party app has access to
    5·1 answer
  • The North American Free Trade Agreement (NAFTA) among Canada, Mexico, and the United States is intended to _____.
    5·2 answers
  • A file must be ________ before data can be written to or read from it. closed opened buffered initialized none of these
    11·2 answers
  • Gina's teacher has sent her a Word document that contains the names of all the students who are participating in the
    11·2 answers
  • What is UNIX? A program for writing documents Graphical interface Internet browser Operating system
    8·2 answers
  • Write and run a Python program that asks the user for a temperature in Celsius and converts and outputs the temperature in Fahre
    10·1 answer
  • A graph of an organization'snet income over the past 10 years is an example of an analogmodel.
    7·1 answer
  • Write a program to randomly fill an array of float of 10 elements (use the rand() function and make sure to use #include ) in ma
    11·1 answer
  • A user purchased a new smart home device with embedded software and connected the device to a home network. The user then regist
    5·1 answer
  • Which of the following describes a recording scout's job in the music industry?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!