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
Solnce55 [7]
3 years ago
15

What is the build in libary function to compare two strings?​

Computers and Technology
1 answer:
worty [1.4K]3 years ago
3 0

Answer:

strcmp() is a built-in library function and is declared in <string. h> header file. This function takes two strings as arguments and compare these two strings lexicographically.

Explanation:

Hope it helps

You might be interested in
Write a program that produces a Caesar cipher of a given message string. A Caesar cipher is formed by rotating each letter of a
PilotLPTM [1.2K]

Answer:

Here is the JAVA program that produces Caeser cipher o given message string:

import java.util.Scanner;  //to accept input from user

public class Main {  

   public static void main(String args[]) {  //start of main function

       Scanner input = new Scanner(System.in);  //creates object of Scanner

       System.out.println("Enter the message : ");  //prompts user to enter a plaintext (message)

       String message = input.nextLine();  //reads the input message

       System.out.println("Enter the amount by which by which to rotate each letter : ");  //prompts user to enter value of shift to rotate each character according to shift

       int rotate = input.nextInt();  // reads the amount to rotate from user

       String encoded_m = "";  // to store the cipher text

       char letter;  // to store the character

       for(int i=0; i < message.length();i++)  {  // iterates through the message string until the length of the message string is reached

           letter = message.charAt(i);  // method charAt() returns the character at index i in a message and stores it to letter variable

           if(letter >= 'a' && letter <= 'z')  {  //if letter is between small a and z

            letter = (char) (letter + rotate);  //shift/rotate the letter

            if(letter > 'z') {  //if letter is greater than lower case z

               letter = (char) (letter+'a'-'z'-1); }  // re-rotate to starting position  

            encoded_m = encoded_m + letter;}  //compute the cipher text by adding the letter to the the encoded message

           else if(letter >= 'A' && letter <= 'Z') {  //if letter is between capital A and Z

            letter = (char) (letter + rotate);  //shift letter

            if(letter > 'Z') {  //if letter is greater than upper case Z

                letter = (char) (letter+'A'-'Z'-1);}  // re-rotate to starting position  

            encoded_m = encoded_m + letter;}  //computes encoded message

           else {  

         encoded_m = encoded_m + letter;  } }  //computes encoded message

System.out.println("Encoded message : " + encoded_m.toUpperCase());  }} //displays the cipher text (encoded message) in upper case letters

Explanation:

The program prompts the user to enter a message. This is a plaintext. Next the program prompts the user to enter an amount by which to rotate each letter. This is basically the value of shift. Next the program has a for loop that iterates through each character of the message string. At each iteration it uses charAt() which returns the character of message string at i-th index. This character is checked by if condition which checks if the character/letter is an upper or lowercase letter. Next the statement letter = (char) (letter + rotate);   is used to shift the letter up to the value of rotate and store it in letter variable. This letter is then added to the variable encoded_m. At each iteration the same procedure is repeated. After the loop breaks, the statement     System.out.println("Encoded message : " + encoded_m.toUpperCase()); displays the entire cipher text stored in encoded_m in uppercase letters on the output screen.

The logic of the program is explained here with an example in the attached document.

8 0
3 years ago
What is the meaning of the phrase the video has gone viral
Kamila [148]

It means it's being spread really quickly all over the world.

3 0
3 years ago
Read 2 more answers
Assume the existence of a Bank Account class. Define a subclass, Savings Account that contains the following: a double instance
Finger [1]

The solution is in the attachment

5 0
3 years ago
How to learning algothrim bett
Stells [14]
The GCSE Computing MOOC (created with Cambridge University Press and Raspberry Pi) can be used either as a course or a flexible teaching resource,
8 0
3 years ago
From an IT perspective, which of the following best describes BI and BI apps?
Natali5045456 [20]

Answer:a)Stand-alone

Explanation: Stand-alone application is the application that is found on the system of every client.In accordance with the IT section, Business intelligence can be transferred into stand-alone application .This helps in the development of the essence of the system at an independent level.

Other options are incorrect because supporting a certain factor will not make it independent, cannot act as the group of ISs technology or web system for gaining profit.Thus,the correct option is option(a).

4 0
3 years ago
Other questions:
  • A(n) _______ allows an attacker to use a network structure to send large volumes of packets to a victim.
    5·1 answer
  • Why is it important to evaluate the website on which you plan to shop?
    11·2 answers
  • MTTF is a file format developed by Microsoft commonly used on Windows systems; it offers file security, large volume size, large
    11·1 answer
  • Reversing the elements of an array involves swapping the corresponding elements of the array: the first with the last, the secon
    6·1 answer
  • What does FLUX do when soldering an electrical joint?
    13·2 answers
  • Examples of analog computer
    8·1 answer
  • A person who creates a computer virus is a (1)system analyst (2) techician(3) programmer​
    11·2 answers
  • Write a program that takes in an integer in the range 10 to 100 as input. Your program should countdown from that number to 0, p
    13·1 answer
  • Array bounds checking should be directly coded into a system rather than assumed.
    12·1 answer
  • My assignment asks me to write a python program using if, elif, and else that takes a user's salary and calculates the tax based
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!