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
Nookie1986 [14]
3 years ago
11

Concatenating arrays Strings have build-in functions to perform concatenation. Write a function called append () that performs c

oncatenation for two char arrays (you will have to pass in a third char array that will hold the result). You will also need to pass in the lengths of each char array. You may not use strings for this part. Sample main code: char first[ ] = {'?', ' ', 'a', 'm', ' '}; char second[ ] = {'i', 'r', 'o', 'n', 'm', 'a', 'n', '\0'} char result[200]; append(first, 5, second, 8, result); cout << result; Example output for code above:
Computers and Technology
1 answer:
olganol [36]3 years ago
4 0

Answer:

Check the explanation

Explanation:

#include<iostream.h>

#include<stdlib.h>

void append(char* first,int n,char* second, int n1,char* result)

{

  int i,j=0;

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

      result[i]=first[i];

  for(i=n;i<n1+n;i++)

  {

      result[i]=second[j];

      j++;

  }

}

void main()

{

  char first[]={'I', ' ','a', 'm', ' '};

  char second[]={'i', 'r', 'o', 'n', 'm', 'a', 'n','\0'};

  char result[200];

  append(first,5,second, 8, result);

  cout<<result;

  cout<<endl;

  system("pause");

}

You might be interested in
Meadowdale Dairy Farm sells organic brown eggs to local customers. It charges $3.25 for a dozen eggs, or 45 cents for individual
svp [43]

Answer:

Explanation:

import java.Util;

public class Eggs{

public static void main (String [] args)

{

int noOfEggs, dozen, units;

float total;

Scanner input = new Scanner(System.in);

noOfEggs = input.nextInt();

if(noOfEggs < 0)

{

System.out.print("Invalid");

}

else

{

if(noOfEggs >= 12)

{

dozen = noOfEggs/12;

units = noOfEggs % 12;

}

else

{

dozen = 0;

units = noOfEggs;

}

total = dozen * 3.25 + (units * 45)/100;

System.out.print("You ordered "+noOfEggs+" eggs.\n");

System.out.print("That's "+dozen+" dozen at $3.25 per dozen and "+units+" loose eggs at 45 cents each for a total of $"+total);

}

}

}

7 0
3 years ago
Which of the following commands would you use to start the program Main with four strings? a. java Main arg0 arg1 arg2 arg3 b. j
kirill [66]

Answer:

The answer is a. java Main arg0 arg1 arg2 arg3

Explanation:

The strings here are called command line argument. These command line arguments allow you to run your program from your terminal/command line. You may think just like passing parameters to a function. Since you have four strings in your program, you need to pass four arguments.

5 0
4 years ago
How can people make sure they are using credit cards responsibly
Ray Of Light [21]
Set a buget based on monthly income
8 0
3 years ago
Read 2 more answers
f the copyright date on the homepage is more than 1 year old, the website should always be considered unmaintained
Lilit [14]
We still have moderators who watch the site every day they are in the process of acquiring a new one 
4 0
3 years ago
One difference between multi-tasking using fork() versus using threads is that there is race condition among threads due to shar
MAXImum [283]

Answer:

vnn

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • What was the first<br> 1:search engine<br> 2:website<br> 3:time the internet started
    6·1 answer
  • Which of the following is the MOST important consideration when planning your budget?
    7·2 answers
  • Open a command prompt on pc-a and pc-b and type ipconfig /all. what are the ethernet adapter physical addresses?
    7·1 answer
  • Select the correct answer from each drop-down menu.
    8·1 answer
  • The NIST SP 800-100 Information Security Handbook provides technical guidance for the establishment and implementation of an inf
    12·1 answer
  • How do I use brainly.<br> What is brainliest.<br> And what is the rating thing about
    6·2 answers
  • What is a query? State it's uses.​
    8·1 answer
  • A list cannot use appendleft but a _____ can.
    11·1 answer
  • Understanding that protection of sensitive unclassified information is:
    8·1 answer
  • How do I find unwanted programs on my computer?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!