The code you give should be a working code fragment. This means if your code was
ID: 3731931 • Letter: T
Question
The code you give should be a working code fragment. This means if your code was inserted program, you should not get any errors. If you are expected to give a function declaration or anything else specific, it will be indicated. indra Export PDF Create PDF Edit PDF 3n +2 D Comment 2, Nadine was promised she will mlake 15% return on her initial investment in 4 years (meaning if she invested $100, at the end of 4 years she is promised to have $115, where $100 is her initial investment Combine Files Organize Pages Fill& Sign Send for Signature and $15 she make? is what she made). After 4 years, she noticed she had made 23% return. How much money did -Send&Track; More Tools 3. ABC Chocolate Company produces 100 chocolates every half hour. Working hours are between 9am and 4pm. What is the daily rate of chocolate production? (Answer should be output to screen like: 40 chocolates/day) 4. Mr. Ritter translates simple sentences for a living, where each translation takes 20 seconds (meaning Upgrade Now O Type here to search 152 AM /18/2018Explanation / Answer
Answer 1)
C program for the above summation equation: 3n + 2 from the values 1 to 7.
#include <stdio.h>
int cal(int n); // function declaration
int main()
{
printf("Starting program");
int result = cal(7); // passing upper limit as 7, i.e 1 to 7
printf(" Result: %d ",result); // printing the result
}
int cal(int n) {
int result=0;
int temp=0;
int i=0;
for(i=1;i<=n;i++){ // loop for calculating 3n+2
temp=((3*i)+2);
result = result+temp;
}
return result; //returning the result to the main function
}
Output:
Starting program
Result: 98