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
Daniel [21]
3 years ago
5

(50 points) Write a program arrays1.cthat checks if two integer arrays are different by one and only one elementwhen compared el

ement by element (first element with first element, second with second, and so on)and displays theelements that are different. The program asks the user to enter the size of the arrays and then the elements of the arrays.
Computers and Technology
1 answer:
Pachacha [2.7K]3 years ago
7 0

Answer:

#include<stdio.h>

int one_element_different(int *a1 ,int *a2 ,int n ,int *element1 ,int *element2) { for (int k=0;k<n;k++) {

if(*a1!=*a2)

return k;

else { a1++; a2++; } }

return 0;

} int main() {

int n;

printf("Enter the length of the array \n");

scanf("%d",&n); int a1[n],a2[n];  

printf("Enter the elements of first array");

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

scanf("%d",&a1[i]);

}

printf("\nEnter the elements of second array ");

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

{

scanf("%d",&a2[j]);

}

int result = one_element_different( a1 ,a2 ,n ,a1 ,a2);

if(result) {

printf("\nArray are Different by one element at %d %d \n ", a1[result], a2[result]);

}

else {

printf("\nArray are NOT Different by one element \n");

}

}

Explanation:

  • Compare each element and if there is any mismatch, return the position of that element otherwise return 0.
  • Get the size from user.
  • If the result has True value, display the message that array are different by one element.
You might be interested in
One friend claims that a dual-core system runs at twice the speed as a single-core system; another friend disagrees by saying th
lidiya [134]

Answer:

<u>the first friend</u>

Explanation:

It is important to <em>remember </em>that a core is the brain of the CPU (central processing unit), which means one who has a dual-core is having <em>"a dual brain" </em><em>to process information faster.</em>

Consider also, IT experts often acknowledge that in terms of speed of execution, it is proven that, "dual-core systems" are <em>faster</em> (even twice faster) than a "single-core system". The other friends were wrong because they disagreed with a widely accepted fact that dual-core is faster than single-core; and of course, <em>we know that without them being faster they can't run twice the applications and twice the data. </em>

Therefore, we can make the conclusion that the first friend's response is correct.

5 0
2 years ago
Human systems integration (hsi), a supportability issue that every program should consider, addresses such factors as accessibil
Tju [1.3M]

I guess the word in the blank is Standardization.

Human systems integration (HSI), a supportability issue that every program should consider, addresses such factors as accessibility, visibility, testability, and Standardization.


6 0
2 years ago
What type of maintenance can prevent the computer from breaking?
qwelly [4]
<span>The answer is, "Load anti-virus software".
</span>Anti-virus softwares are used to prevent computer from virus, as it name shows that are anti-virus means they prevent from virus. Anti virus softwares are also known as anti-malware software. These software work in such a way that they <span>prevent, detect and then remove viruses or </span><span>malicious software.</span>
3 0
3 years ago
Read 2 more answers
"As part of integrating your solution your client indicates that they have certain technologies enabled on their network that al
erastovalidia [21]

Answer:

quality of service

Explanation:

6 0
3 years ago
Which of the following scan only works if operating system’s TCP/IP implementation is based on RFC 793?
Shkiper50 [21]

Answer:NULL Scan

Explanation:RFC 793(Request for comments) is a type of RFC command labeled with the number 793 which can operate with the TCP protocol.They are sort of document form which is from IETF( Internet Engineering Task Force ).

The null scan is scanning protocol used by legal as well as illegal hackers for working in the transfer control protocol architecture. It is used for the identification of the the ports and holes in TCP servers.they can also have the negative impact if used by the illegal hackers.

5 0
2 years ago
Other questions:
  • Which activity represents a violation of the licensing agreement
    7·2 answers
  • The _____ is the area in Microsoft Excel where you can perform file commands such as Save, Open, and Print
    15·1 answer
  • A motherboard has four DIMM slots; three slots are gray and the fourth is black. What type of memory is this board designed to u
    6·1 answer
  • This week you will learn about basic code structure. The term structure, as it relates to programming, refers to the decisions y
    14·1 answer
  • Write two cin statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a dash,
    7·1 answer
  • Dora has inserted a text box into a Word document that she is formatting. Which strategy will not format text boxes? Create a li
    6·2 answers
  • Please write a Java program to read movies.txt file. (It is in Modules under Chapter Code) Create your own movies.ser file from
    14·1 answer
  • Hiya people. I am a game developer and I need an idea for a new game. If you have any ideas, pls feel free to tell me. Best idea
    6·2 answers
  • 1. Which of the following cables are used in networking? Check all that apply.
    8·2 answers
  • Enterprise storage systems typically use fast Fibre Channel or ____ connections and are scalable so more hard drives can be adde
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!