import java.util.Scanner;
public class JavaApplication83 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter Strings: ");
String word1 = scan.nextLine();
String word2 = scan.nextLine();
String newWord = "";
if (word1.length() == word2.length()){
for (int i = 0; i < word1.length(); i++)
{
newWord += word1.charAt(i) +""+word2.charAt(i);
}
}
else{
newWord = "error";
}
System.out.println(newWord);
}
}
I hope this helps!
Answer: Option D -- Sorting an already sorted array of size n with quicksort takes O(n log n) time.
Explanation:
Sorting an already sorted array of size n with quicksort takes O(n log n) time is true about sorting functions while other options are wrong.
Answer:
ang haba po grabe hahahhaahhahahahahah
Explanation:
pabrainlest po t.y
The program is an illustration of loops.
Loops are used to perform repetitive and iterative operations.
The program in C++ where comments are used to explain each line is as follows:
#include <iostream>
using namespace std;
int main(){
//This declares and initializes all variables
string star = "*", blank = " ", temp;
//The following iteration is repeated 8 times
for (int i = 1; i <= 8; i++) {
//The following iteration is repeated 8 times
for (int j = 1; j <= 8; j++) {
//This prints stars
if (j % 2 != 0) {
cout << star;
}
//This prints blanks
else if (j % 2 == 0) {
cout << blank;
}
}
//This swaps the stars and the blanks
temp = star;
star = blank;
blank = temp;
//This prints a new line
cout << endl;
}
}
Read more about similar programs at:
brainly.com/question/16240864