0 like 0 dislike
4.7k views
Show more...
[Exercise] Coding (C) - asked in Chapter 9: Functions by (5.2k points)
ID: 37277 - Available when: 2017-12-14 18:00 - Due to: Unlimited

edited by | 4.7k views

38 Answers

0 like 0 dislike
Hidden content!
#include * * * * ****
double ** * * * * ** b[],int n)
{
* * * * * * * * * * i,j;
******* * * ** *** * *** **** **
* ** *** * * ** * * *
* ** ** * ** * *** ** * * * * * ** * ** * ** * **
******* * *
return j;
* * ***** * ** ** * * function should return a[0] * b[0] + a[1] * b[1] + ... + a[n-1] * b[n-1].
}

int **
{
** **** ****** * ****** * **
* * ** * * **** * * c, n;

******* ***** ** * *** *** ** * *** //Enter number of *** in array
**** * * * *** ** * ( c = 0 ; c ** n ; c++ ) * * **** ** * * *** * ** array A
* ** *** *** *** * **** *** ** *** * * ** * *** *
** ********** ** * ( c = 0 ; c ** n ; c++ ) * * *** *** *** ** * ** ** array B
* * * ** *** ** *** ** ****** *** ** * ** * *** * * ** *** ***

* ** ******* * * * ** ** *** ** * * ** **

*** * 0;
}
answered by (-301 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include **** *
double * * * * *** * a[],double b[],int n)
{
* * * ** *** ** *** i,sum=0;
* ** * * *** *** * {
**** * * ** * ** ** * ** *** ** * * ** *** **
** * * * * * * *** **
* * * * * ** ** ** sum;
}

int main(void)
{
* * * ** ****** * * * * ** * arrayB[100];
* * * * * * ** ** c, n;

** *** ** * * * * ** ** * * * //Enter number of elements in array
**** * **** * ( c = 0 ; c < n ; c++ ) *** ** * ** *** * ** * * *** array A
* * * * * *** * *** * * * ******** * * ** * * * **** * *
** * * * ** ** * ( c = 0 ; c < n ; c++ ) ** * ****** **** ** * array B
** * ** *** * **** * * *** * * ** ** ** * *** *** * ***

** ***** * * * * *** * ** * ****** * * ******* **

* * ** * * ** ** 0;
}
answered by (-120 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include * ** * * ***
double ***** * **** *** arrayB[],int n)
{
* * ** * ** ** ** ** ** YOUR CODE HERE*/
* *** ** ****** * * c, p;
* * * *** * *** *** * ** ** * ***
* **** * * ** ***** **
** * * * * ***** * * * ** * * *** * * * *** * ** *
* * ** **** ****
** ** ** ** * ** * OF YOUR CODE*/
*** ** * * ***** p;
}

int main(void)
{
** * ** **** * **** ** * arrayB[100];
* * * * * **** * * c, n;

* ** ** * ** * ** * * * *** * ** //Enter number of elements in array
**** ** ** * * ** * ( c = 0 ; c < n ; c++ ) ***** *** * * ****** *** * array A
** * * *** * ******* **** * **** * * * *** **** ***
*** ** ***** **** * ( c = 0 ; c < n ; c++ ) * * *** *** *** * ********** array B
* * * ****** *** * * * *** *** *** * **** * ** ** ** * ******

* * *** * ** ** * ** * **** *** * * ** * * *** ****

***** * ** * 0;
}
answered by (-249 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include * **** ** *
double * * * * a[],double b[],int n)
{
* **** * * * i,sum=0;
** * ** *** **** * * **
** ** ***** * * **
** * * ** ***** ** *** * * * ** **** ***
**** ** * * **
** * ** ** * ********** ** sum;
}

int main(void)
{
** ******** * * arrayA[100], ** * *
** ** *** ** * c, n;

* ** ** ** * ** * * ** * * *** //Enter number of elements in array
** ** * *** *** ( c = 0 ; c < n ; c++ ) * * ** *** ** * * ** array A
** * * * * *** **** ** **** * **** * * * * ** * * ** **
***** * * ** ** * * * ( c = 0 ; c < n ; c++ ) * * * * ** * * * ** ** * * array B
** ** ** ***** ** * ** * ***** ** * *** ** * * * ***

* * ** * * **** * **** ** * ********* ******* ** *

** * * * ** * **** 0;
}
answered by (-498 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include * * **
double * ** ** * * ** * b[],int n)
{
* ** * * i,c=0;
** ** ** ******* *** * **
**** * * **
* ****** * * * ** * * * * * * * *** **
* * **** ***
return c;
}

int main(void)
{
* * *** ** * *** *** * * * *
** ** * ** * ** * c, n;

*** ** * * *** * ** ** **** ** * ** * //Enter number of elements in array
* * * *** * * ***** ( c = 0 ; c < n ; c++ ) **** * ** * * * * * ** * array A
*** ** * *** * * ** * * * ** ** ***** ****** **** *
* * * ** * ( c = 0 ; c < n ; c++ ) * * * ** *** ** *** ** * ** array B
*** * **** * * *** *** * * ** *** * **** * * * * **

* ** * * * ***** ** * * * * ** ******** * ** * **

* * ***** ** ** * 0;
}
answered by (-258 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include *** **** ** *
double ***** * * * a[],double b[],int n)
{
* * ***** * ** ** * sum;
* * * ** **** * ** * * * * i=0;
*** ******** *** * ** *** ** ***
** ** ** * **** * * *** ***** * ** * * * ****
* **** * *** * **** **

* *** *** ******* * ** * * sum;
}

int main(void)
{
* * * ** ** * ** ** * * arrayB[100];
****** *** * * *** * ***** c, n;

** ** *** * *** * ** ** * ** ** **** //Enter number of elements in array
* *** **** ** * ** ( c = 0 ; c < n ; c++ ) * * **** * ** * * * **** array A
* **** * ** * ** * **** * *** ** * * *** * * * ***
** ** * * *** * ( c = 0 ; c < n ; c++ ) * * * * * * ** * * *** array B
* * ** * *** * * *** *** * **** *** * *** * *** * * ** ** *

* * * * * **** ***** * ** ** * **** * *** *

**** **** * * ** ** *** 0;
}
answered by (-140 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include ***** * * ** *
double **** * ** *** a[],double b[],int n)
{
*** * **** *** * * *** * * sum;
** * ******* * * ** ** * * i=0;
******** ** ** * * ** * ***
* ***** ** * * *** * ***** * *** *** * * * *** *
***** * * *** ******* ****

****** *** * *** ** *** * sum;
}

int main(void)
{
*** * *** *** ** * ***** arrayB[100];
** * ** * * *** c, n;

* * ** * * * * ***** * ** * ** ** ** * * * //Enter number of elements in array
****** * **** * ( c = 0 ; c < n ; c++ ) ** ** *** * ** ** * ** * array A
* * * ** * * * *** ** ** * * *** ** * ** * * * ** ***
** * * *** *** * ( c = 0 ; c < n ; c++ ) * * ** ** ** ** ** array B
** ** * * *** ******* * * ** ** ** ** * * *** * *

* ** * * * * * **** ** ** * * * * * * *****

* * * * * ** 0;
}
answered by (-116 points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 like 0 dislike
Hidden content!
#include * * ** ******
double ** ** * * * * b[],int n)
{
**** * * * * *** * * *** i, result = 0;
** * *** * ** *** (i = 0; i ** n; i ++)
*** * ** * * * * * *** ** * *** ** *** * ** += a[i] * b[i];
* *** * * * **** *** ** * result;
}

int **
{
* *** * * * * ** * **** *** * *
**** ***** ** * c, n;

***** ** * * ** ** * * **** ** * * //Enter number of * in array
* ** ** ** ** * ( c = 0 ; c * n ; c++ ) * ** ** * ***** ** array A
** * * ** * * * * *** ** *** * *** ** * ** ** *** ** ** * * * **
* * * ****** ( c = 0 ; c < n ; c++ ) * * ** **** * * * ** ** array B
* ** * ** * * ** * * ** *** * ****** ** * * **** ***

** * **** * * *** *** *** * *** ****** * * ** * * ** ****

* **** ***** * * *** ** 0;
}
answered by (5.2k points)
0 0
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
0 0
-----------Re-judge-----------
Case 0: Correct output
Case 1: Correct output
Case 2: Correct output
Welcome to Peer-Interaction Programming Learning System (PIPLS) LTLab, National DongHwa University
English 中文 Tiếng Việt
IP:172.69.7.113
©2016-2025

Related questions

0 like 0 dislike
50 answers
[Exercise] Coding (C) - asked Dec 13, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 37278 - Available when: 2017-12-14 18:00 - Due to: Unlimited
| 6.8k views
0 like 0 dislike
41 answers
[Exercise] Coding (C) - asked Dec 14, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 37370 - Available when: 2017-12-14 18:00 - Due to: Unlimited
| 4.9k views
0 like 0 dislike
70 answers
[Exercise] Coding (C) - asked Dec 7, 2017 in Chapter 9: Functions by semicolon (5.2k points)
ID: 35783 - Available when: 2017-12-07 18:00 - Due to: Unlimited
| 8k views
12,783 questions
183,442 answers
172,219 comments
4,824 users