Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

[ Prob . 6 . Fundamental of Programming ] ( 2 0 p ) Write the output of the following C program. #include stdio .

[Prob.6. Fundamental of Programming]
(20p) Write the output of the following C program.
#include stdio.h
void foo(int x, int ***y, int ***z, int w)
{x++;
**y=**y+1;
(**z)+=1;
w --;
}
int main()
{
int A[]={0,1,2,3};
foo(A[0],&A[1],A+2,**(A+3);
printf("%d,%d,%d,%d", A[0], A[1], A[2], A[3]);
}
(25p) For a given integer array A[], whose size is M and whose element values
range between 0 and N-1, the following program computes C[i](0iN-1), the
number of elements in A[] which are less than or equal to i (for our example A[],
the printf statement will print C[0]=1C[1]=2C[2]=4C[3]=6,dots,C[8]=13C[9]=15; e.g..
C[2]=4 since there are four elements, A[2],A[3],A[9], and A[11], which are 2).
#include stdio.h
#define M 15
#define N 10
int A[M]={3,5,2,1,5,6,9,3,7,0,5,2,4,9,7};
int C[N]={0,0,0,0,0,0,0,0,0,0};
int B[M], i;
for (A[]iC[i]A[]ii,C[i]CCi=0;i
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Is the plan for handling incoming guests effective?

Answered: 1 week ago