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
lakkis [162]
4 years ago
8

Write a program to read 2 numbers and display the largest of the two. You should use scanfto read the two numbers and use if sta

tement to see which number is larger
Computers and Technology
1 answer:
Harman [31]4 years ago
8 0

Answer: in C

#include <stdio.h>

int main(){

  int num1, num2;

  printf("Enter first number :: ");

  scanf("%d", &num1);

  printf("Enter second number :: ");

  scanf("%d", &num2);

 

  if(num1 > num2){

     printf("%d is larger than %d\n", num1, num2);

  } else if (num2 > num1) {

     printf("%d is larger than %d\n", num2, num1);

  } else{

     printf("Both of them are equal\n");

  }

  return 0;

}

You might be interested in
A ________ is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood t
VLD [36.1K]

Answer:

a.material control failure

Explanation:

A material control failure is a material deficiency, or combination of significant deficiencies, that results in more than a remote likelihood that a material mis-statement in the annual or interim financial statements will not be prevented or detected.

7 0
4 years ago
A report formatted where the page is taller than it is wide is formatted in ____.
alexandr402 [8]
Portrait Orientation
5 0
3 years ago
The length of a hailstone sequence is the number of terms it contains. For example, the hailstone sequence in example 1 (5, 16,
11111nata11111 [884]

Answer:

Following are the program to this question:

#include <iostream> //defining header file

using namespace std;

int hailstoneLength(int n) //defining method hailstoneLength

{

int t=1; //defining integer variable assign  

while(n!=1) //define a loop that checks value is not equal to 1

{

if(n%2==0) // check even number condition

{

n=n/2; // divide the value by 2 and store its remainder value in n

t++; //increment value of t by 1.

}

else

{

n=n*3+1; //calculate and hold value in n  

t++; //increment value of t variable by 1  

}

}

return t; //return value

}

int main() //defining main method

{

int n; //defining integer variable

cout<<"Enter any number: "; //print message

cin>> n; //input value

cout<<hailstoneLength(n); //call method and print its value

return 0;

}

Output:

Enter any number: 3

8

Explanation:

Program description can be given as follows:

  • In the given C++ language program an integer method "hailstoneLength", is declared, that accepts an integer variable "n" in its parameter.
  • Inside the method, an integer variable t is declared, that assign a value that is 1, in the next line, a while loop is declared, that uses if block to check even condition if number is even it divide by 2 and increment t variable value by 1.
  • If the number is odd it will multiply the value by 3 and add 1 and increment t by 1 then it will go to if block to check value again. when value of n is not equal to 1 it will return t variable value.
  • In the main method, an integer variable "n" is used that call the method and print its return value.
7 0
3 years ago
A(n) ____________ calculator is a device that assists in the process of numeric calculations but requires the human operator to
Zielflug [23.3K]

Answer:

The answer that goes in the blank is <u>manual</u>

Explanation:

Have a good day :)

8 0
2 years ago
What are Manuscript signs​
mihalych1998 [28]

Answer: See explanation

Explanation:

Manuscript signs, refers to the marks or the symbols that are used within a manuscript in order to show the necessary corrections which should be made during the preparation of a document.

Manuscript formatting is vital as it makes the manuscript easier to assess. In a situation whereby manuscripts are poorly formatted, it can be turned down by agents and publishers.

5 0
3 years ago
Other questions:
  • _____________ is the characteristic of a resource that ensures that access is restricted to only permitted users, applications,
    14·1 answer
  • Optimally, the __________ guides investment decisions and decisions on how ISs will be developed, acquired, and/or implemented.
    6·1 answer
  • Which of the following economic systems leaves production decisions completely up to the producers?
    15·2 answers
  • What did do you do if you made a mistake on a computer?
    14·2 answers
  • What is a feature of Print Preview? Fit to Document Fit to Margin Fit to Page Fit to Size
    5·2 answers
  • What are the most commonly found items in the trash according to the Municipal Solid Waste report?
    12·2 answers
  • Special words are those words that start and end with the same letter. [14]
    12·1 answer
  • Window frame will expand to fill the entire desktop when you
    12·1 answer
  • What is the Role of an algorithm?
    11·1 answer
  • State and give reason, if the following variables are valid/invalid:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!