Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables
int n;
double average,sum=0,x;
cout<<"enter the Value of N:";
// read the value of N
cin>>n;
cout<<"enter "<<n<<" Numbers:";
// read n Numbers
for(int a=0;a<n;a++)
{
cin>>x;
// calculate total sum of all numbers
sum=sum+x;
}
// calculate average
average=sum/n;
// print average
cout<<"average of "<<n<<" Numbers is: "<<average<<endl;
return 0;
}
Explanation:
Read the total number from user i.e "n".Then read "n" numbers from user with for loop and sum them all.Find there average by dividing the sum with n.And print the average.
Output:
enter the Value of N:5
enter 5 Numbers:20.5 19.7 21.3 18.6 22.1
average of 5 Numbers is: 20.44
When someone may be giving away something for free.
Answer: False
Explanation:
A skillful response is defined as, answering the response in a skillful manner with all the technical and skillful approach. Firstly, read the question carefully and answer according in a proper format manner. Affirmation and answer are not enough for the skillful response as, it also include various kinds of approach like it should be error free and declaration of the answer should be in format, meaningful and proficient.
Answer:
-10
Explanation:
Given hex number = 0x FFF6
Converting it to binary: 1111111111110110
Generating 1s complement of the binary representation by inverting the bits :
0000000000001001
Adding 1 to generate the 2's complement :
0000000000001001 + 1 = 0000000000001010
Converting it to decimal , this corresponds to 10
So the 2s complement of original number is 10. This means that the original number is -10.
Answer:
The correct answer for the given question is " The Code fragment A runs fastly than the code fragment of B".
Explanation:
In this question there are some information is missing i. e options. The question does not give any options. The options for the given question is given below
(A.) The Code fragment A runs fastly than the code fragment of B.
(B.) The Code fragment B runs fastly than code fragment of A.
(C) The Code fragment A runs as fastly as code fragment of B.
So we conclude the answer i.e option(A) because As given in the question list1 is a MyArrayList and list2 is a MyLinkedList. , in list1 we fetching the data easily and fastly means that it remove the data easily as compare to list2 As MyArrayList is storing the list only and also we can fetch the data easily manner.
The list2 is an object of MyLinkedList means that it manipulating the data fastly as compared to MyArrayList but if we compared the fetching of data then MyArrayList is a better option so the code fragment runs fastly then code fragmented B.