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

Assign True to the variable has_dups if the string s1 has any duplicate character (that is if any character appears more than on

ce) and False otherwise.
Computers and Technology
1 answer:
podryga [215]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   string s;

   cin>>s;    //reading string

   int i,j;

   bool has_dups=false;

   int n= s.length();

   for(i=0;i<n;i++)  //to check for duplicate characters

   {

       for(j=0;j<n;j++)

       {

           if(j!=i && s[i]==s[j])  //to check if it is matched with itself

           {

               has_dups=true;  //if true no need to check others

               break;

           }

       }

   }

   cout<<has_dups;

   return 0;

}

OUTPUT :

California

1

Explanation:

Above program finds if a character repeat itself in the string entered by user.

You might be interested in
What part of the code is a signal for the function to execute and pass back a value?
Trava [24]

Answer:

2

Explanation:

6 0
3 years ago
Read 2 more answers
Applications require you to provide the following basic elements: social security number, experience, and favorite memories. Tru
Aleonysh [2.5K]

Answer:

False. Only Experience and sometime your social security number

Explanation:

Most job applications will require you to provide your past and current work experience. Some will ask you to provide your social security number while many of them will not. No companies will ever ask you to provide your favorite memories as a basic element in a CV or Cover Letter. It might happen on rare occasions but that would sound funny if they did.

3 0
3 years ago
The incompatibilities in speed between the various devices and the CPU make I/O synchronization difficult, especially if there a
Iteru [2.4K]

Answer:

In a buffer

Explanation:

We can define a buffer as a temporary holding area for data between the various devices and the CPU make I/O synchronization especially if there are multiple devices attempting to do I/O at the same time.

Items stored at the buffer helps to reduce the The incompatibilities in speed between the various devices and the CPU.

3 0
3 years ago
You want to find the distance between two points.
maks197457 [2]

Answer:

For the first picture, choose the second pair, and for the second one, choose the first pair

Explanation:

5 0
3 years ago
Literacy is best defined as knowing how to: (Points : 1)
iragen [17]
Read and write. Think of the term "literacy rate" it refers to how much of a population can read and write.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which Google Analytics visualization compares report data to the website average?A. Pivot viewB. Comparison viewC. Performance v
    8·1 answer
  • There is no way to see how another project in Scratch was made.<br><br> True<br> False
    11·1 answer
  • The ________________ command tests connectivity by sending an echo request to a remote computer.
    14·1 answer
  • A network administrator has been creating a baseline of network performance. During this process, he realizes that one router is
    14·1 answer
  • Which image shows organic shapes? <br> A. image 1 <br> B. image 2 <br> C. image 3 <br> D. image 4
    14·2 answers
  • Your computer is configured to obtain an ipv4 address and dns server address automatically. what utility will help you to find t
    12·1 answer
  • On his computer desktop, Rodney can see several different files, each immediately accessible. Because he is actively working on
    13·1 answer
  • What is the extension of a Microsoft access database 2013​
    7·2 answers
  • Need Help Please
    7·1 answer
  • You text file begins with the following rows. The pattern is a description of the item to be repaired, its color, and the issue.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!