The answer is performing arithmetic and logical operations
true
Screenshots are basically snapshots of your computer screen. You can take a screenshot of almost any program, website, or open window. PowerPoint makes it easy to insert a screenshot of an entire window or a screen clipping of part of a window in your presentation.
Answer:
The program to this question can be given as:
Program:
#include<stdio.h>//include header file
int main() //defining main method
{
printf("Hello..! and please vote the answer."); //print value.
return 0;
}
Output:
Hello..! and please vote the answer.
Explanation:
In the given question some information is missing that is the message to be printed, In this code assume some message to be displayed, and the description to the above code as follows:
- In the above code firstly header file is included for using a basic function like print method, input method, etc.
- In the next line main method is defined, inside the main method a print function is used in this function a message is passed with a double-quote ("'). When the code will execute it will print the message that is given in the output section.
import java.util.Scanner;
public class JavaApplication86 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int x = 0, c = 0, sum = 0;
while (true){
x = scan.nextInt();
System.out.println("You entered: "+x);
if (x == -1){
break;
}
sum += x;
c++;
}
System.out.println("The sum is "+sum);
System.out.println("You entered "+c +" numbers");
}
}
This works for me. Instead of subtracting one from c and adding one to sum, I used an if statement to break away from the while loop if the entered number is -1.
Answer:
Merge sort is a sorting technique based on divide and conquer technique.
Explanation:
MERGE(A, p, q, r)
n1 = q - p + 1
n2 = r - q
L[1..n1] and R[1..n2] this creates the new array
for i = 1 to n1
L[i] = A[p + i - 1]
for j = 1 to n2
R[j] = A[q + j]
i = 1
j = 1
for k = p to r
if i > n1
A[k] = R[j]
j = j + 1
else if j > n2
A[k] = L[i]
i = i + 1
else if L[i] ≤ R[j]
A[k] = L[i]
i = i + 1
else
A[k] = R[j]
j = j + 1