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
AleksAgata [21]
3 years ago
12

Write a program that uses the function strcmp() to compare two strings input by the user. The program should state whether the f

irst string is less than, equal to, or greater than the second string7. Write a program that uses the function strcmp() to compare two strings input by the user. The program should state whether the first string is less than, equal to, or greater than the second string
Computers and Technology
1 answer:
Andru [333]3 years ago
3 0

user_str1 = str ( input ("Please enter a phrase: "))

user_str2 = str ( input("Please enter a second phrase: "))

def strcmp (word):

user_in1 = int (len(user_str1))

user_in2 = int (len(user_str2))

if user_in1 > user_in2:

return "Your first phrase is longer"

elif user_in1 < user_in2:

return "Your second phrase is longer"

else:

return "Your phrases are of equal length"

You might be interested in
A string is represented as an array of characters. If you need to store an array of 5 strings with the maximum length of a strin
erastova [34]

Answer:

char str[5][100]

Explanation:

See attachment for options:

From the options, we can see that the programming language is C language.

The syntax to store an array of m strings with a maximum of n elements in C is:

char array-name[m][n]

In this case:

m = 5 --- Number of strings in the array

n = 100 --- Maximum character in each string

Assume the array name is str, the syntax can be expressed as:

char str[5][100]

3 0
2 years ago
To navigate through your presentation slides, which key on your keyboard can you use?<br> Dankonace
jekas [21]

Answer:

You use your arrow keys

Explanation:

4 0
3 years ago
CODEHS 3.5.4 Obi-Wan Says
Likurg_2 [28]

The program receives inputs for the name, number of droids and wookiees a user wants and displays the information as a complete sentence. The program written in python 3 goes thus :

name = input('Enter name : ')

<em>#</em><em> </em><em>prompts</em><em> </em><em>user</em><em> </em><em>of</em><em> </em><em>name</em><em> </em>

num_droid = int(input('number of droids : '))

<em>#prompts</em><em> </em><em>for</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>droids</em><em> </em>

num_wooks = int(input('number of wookiees : '))

<em>#prompts</em><em> </em><em>for</em><em> </em><em>number</em><em> </em><em>of</em><em> </em><em>wookiees</em><em> </em>

print(name, ' wants to meet', num_droid, 'droids and',num_wooks , 'Wookiees' )

<em>#displays</em><em> </em><em>the</em><em> </em><em>information</em><em> </em><em>as</em><em> </em><em>a</em><em> </em><em>complete</em><em> </em><em>sentence</em><em> </em>

<em>A</em><em> </em><em>sample</em><em> </em><em>run</em><em> </em><em>of</em><em> </em><em>the</em><em> </em><em>program</em><em> </em><em>is</em><em> </em><em>attached</em><em> </em>

<em>Learn</em><em> </em><em>more</em><em> </em><em>:</em><em> </em><em>brainly.com/question/25506437</em>

5 0
3 years ago
What can we learn from the example of the wi-fi alliance with regard to the necessity of networking standards?
Vera_Pavlovna [14]
The Wi-Fi alliance is an alliance that promotes the wireless technologies and the interoperability between them. It defines the the security of the wireless technologies and the application protocols. From this example we can learn that is crucial to have one platform that defines the main characteristic of a type of network in order to have strictly defined standards and protocols, and by doing so, have interoperable networks. 
7 0
3 years ago
The primary objective of database design is what?
professor190 [17]

Answer:

D)

Explanation:

4 0
3 years ago
Other questions:
  • Newt Corporation, headquartered in Los Angeles, is a nationwide provider of educational services to post-graduate students. Due
    9·1 answer
  • In what decade did the Internet begin to be used widely by the public and not just government entities?
    5·2 answers
  • The computer program that Josh is working on presents him with a sentence in which a word has been underlined. Josh has to indic
    9·1 answer
  • Which line in the following program will cause a compiler error? #include using namespace std; int main() { int number =5; if (n
    10·1 answer
  • What are three consequences of a negative digital Trail​
    9·1 answer
  • The letters a, e, i, o and u are the only vowels. Write a function named vowelUseDict() takes a string t as a parameter and comp
    7·1 answer
  • What does the revolver do computer science​
    9·1 answer
  • Describe the impact of improvement ls in technology and transportation on american citizens. ​
    7·1 answer
  • HELP TIMED!!!!!!!!!!!!!!!!!!!!
    5·2 answers
  • Write the code in python to ask the user to input two integers. Your program will then print the greatest common divisor of the
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!