Question

Summation Homework 1 Summation Homework From the following program fragment given below: 2-1 sumo for to n-1 do for je to do

0 0
Add a comment Improve this question Transcribed image text
Answer #1

i 2 times sumo for to n-1 for it to 12-1 do for k0 to j-1 do sum sum + 1 end-for end-for end-for write sum Value of sum voora

امر د ۱- Sumon) = = (1) 3 33 : ؟ ۹۰ دو 2. 1- 1-1 نان ع ع ذ ما يتم !ته 0: ن ہ-1 (2-1) i2 2 =0 6 ۔ ) ۔ کر۔ ق ۔ م م ) . . ما به

Summation Expansion Equivalent Value n k = 1+2+3+4+..+n = (ทำ + n) / 2 = (1/2) + (1/2)n k=1 = 1 + 4 +9+ 16 ++ n = (1/6)n(n+1)

******************************************************************************************
PLEASE LIKE IT RAISE YOUR THUMBS UP
IF YOU ARE HAVING ANY DOUBT FEEL FREE TO ASK IN COMMENT SECTION
******************************************************************************************

Add a comment
Know the answer?
Add Answer to:
Summation Homework 1 Summation Homework From the following program fragment given below: 2-1 sumo for to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I want to create a program that first calculate the summation from 1 to R. This code will computes the summation from 1...

    I want to create a program that first calculate the summation from 1 to R. This code will computes the summation from 1 to R with single thread. #include <pthread.h> #include <unistd.h> #include <stdlib.h> #include <assert.h> #include <stdio.h> #define NuMBer_THREADS 2 #define R 1e4 long long sum = 0; // matrix multiplication is  c = a * b; void calculatesum() { int i=1; for(i=1;i<=N;i++) { sum+=i; asleep(100); } } // Thread function // Each thread calculates the summation over (R...

  • Write a C++ program using a function called sum that calculates the following summation: p=2+5 F...

    Write a C++ program using a function called sum that calculates the following summation: p=2+5 F = i2 + 5 i=1 Where n is provided by the user in the main function. The function calculates the sum and return it to the main function to display it.

  • C++ 3. Write a program that reads integers from a file, sums the values and calculates...

    C++ 3. Write a program that reads integers from a file, sums the values and calculates the average. a. Write a value-returning function that opens an input file named in File txt. You may "hard-code" the file name, i.e., you do not need to ask the user for the file name. The function should check the file state of the input file and return a value indicating success or failure. Main should check the returned value and if the file...

  • EX 1) Determine the outcome of the following code fragment without writing and running the program....

    EX 1) Determine the outcome of the following code fragment without writing and running the program. int num = 0, max = 20; while (num <= max) {     System.out.println(num);     num += 4; } EX 2) Write a code fragment that reads and prints integer values entered by user until a particular sentinel value (stored in constant SENTINEL) is entered. Do not print the sentinel value.                 Ex 3)  Write a method called averageLargestTwo  that accepts three int parameters  and returns the average...

  • please code in basic c++ program Write a program that uses the following formula: n (ax...

    please code in basic c++ program Write a program that uses the following formula: n (ax - ib) i=1 Your program will prompt the user for the number of iterations for the calculation. input values for n, x, a, b, and c. n must be a positive integer, but x, a, b, and c can be any real numbers. Then it will perform the calculation and output the result. Then, it will ask the user if they would like to...

  • 2. What is the output of the following code fragment? n = 1; while (n <=...

    2. What is the output of the following code fragment? n = 1; while (n <= 5) { n++; cout << n << ' '; a.1 2 3 4 5 b. 1 2 3 4 c. 1 1 1 forever d. 2 3 4 5 e. 2 3 4 5 6 3. What is the termination condition for the following While loop? while (beta > 0 && beta < 10) { cout << beta << endl; cin >> beta; }...

  • Please change this 2 thread program to a 4 thread program. /*compile as "gcc thread.c -pthread"...

    Please change this 2 thread program to a 4 thread program. /*compile as "gcc thread.c -pthread" */ #include <pthread.h> #include <stdio.h> #include <time.h> #define SIZE 100000000 //100 M //#define SIZE 10000 #define NUMBER_OF_TIMES 100 float a[SIZE]; typedef struct {        int start;        int end;        double sum;        int pid;    } range; void *thread_function(void *arg) //define a function that will be executed from //within a thread {    range *incoming = (range *) arg;...

  • Write a complete C++ program that reads students names and their test scores from an input...

    Write a complete C++ program that reads students names and their test scores from an input text file. The program should output each student’s name followed by the test scores and the relevant grade in an output text file. It should also find and display on screen the highest/lowest test score and the name of the students having the highest/lowest test score, average and variance of all test scores. Student data obtained from the input text file should be stored...

  • Write a C++ program that computes the following series: sum = 1/firstPrime + 2/secondPrime+…..+1/nthPrime Your program...

    Write a C++ program that computes the following series: sum = 1/firstPrime + 2/secondPrime+…..+1/nthPrime Your program should prompt the user to enter a number n. The program will compute and display sum based on the series defined above. firstPrime: is 2 secondPrime: the first prime number after 2 thirdPrime: the third prime number …. nth prime: the nth prime number Your program must be organized as follows: int main() { //prompt the user to enter n //read n from the...

  • Trying to solve the following problem based on the below program. It's from Chapter 2 in...

    Trying to solve the following problem based on the below program. It's from Chapter 2 in Computer Systems (Fourth Edition) by J. Stanley Warford Section 2.4 . The function sum in Figure 2.25 is called for the first time by the main program. From the second time on it is called by itself. "(a) How many times is it called altogether? (b) Draw a picture of the main program variables and the run-time stack just after the function is called...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT