C Functions with Arrays as a Parameter

How do I ? Write a program that a. Defines an array of short integers of size 10
.
b.Calls the function InputValues that prompts the user to input 10 values and stores them into its array parameter.
c.Prints a label and then calls the function printArray which prints the contents of its array parameter.
d.Calls the function sameFirstLast that returns true if the first and last elements of its array parameter have the same value.
e.Prints a message based on the value returned from sameFirstLas t.f. Calls the function firstLast42 that returns true if either the first or last element of the array is equal to 42.
g.Prints a message based on the value returns from firstLastN .
h.Calls the function sum Array that returns the sum of the values in its array parameteri. Prints the sum returned from sumArray with an appropriate label.

#include <stdio.h>
#include <stdlib.h>
#define bool int
// function prototype
void InputValues(short m[],int size);
void PrintArray (short[], int size);
bool sameFirstLast(const short a [], short[]);
int sumArray (short[], short[]);
int rotate2(short[]);


int main()
{
  int count, num;
  short Values [10][10] ;

  printf("Enter 10 numbers %d %d%d%d%d numbers\n", num);


}
void InputValues(short [][])
{
 printf("Called InputValues!\n");
      while ( a < &  >> true[count] )
	        {
	         count;
	        }

	  size = count;

}void InputValues(short m[],int size); // function prototype
        while ( count < 10  &&  >> true[count] )
	        {
	         count;
	        }

	  size = count;

	  ();

PrintArray ([], size)

{
    for( i = 0; i < 10; i++ )
			scanf("%lf", &number[i] );
        while ( count < 10  &&  >> true[count] )
	        {
	         ++count;
	        }
}
bool sameFirstLast(const short a [], short[]);for(i = 0; i<10; ++i)
    {
			scanf("%d", &values[i] );
        while ( count < 10  &&  >> true[count] )
	        {
	         ++count;
	        }
    }
FirstLast42([42],[])
for( i = 0; i < 10; ++i )
			scanf("%d", &values[i] );
        while ( count < 10  &&  >> true[count] )
	        {
	         ++count;

sumArray([],[])

for( i = 0; i < 10; ++i )
			scanf("%d", &values[i] );
        while ( count < 10  &&  >> true[count] )
	        {
	         ++count;
rotate2([6][6]={1,2,3,4,5,6},{3,4,5,6,1,2}

for( i = 0; i < 10; ++i )
			scanf("%d", &values[i] );
        while ( count < 10  &&  >> true[count] )
	        {
	         ++count;

InputValues( short[10])



    return 0;
}

Is this homework?? :\ please intend the code! And if it not a home work please do post the link of the question.

@bipin2 atleast he has given it a shot(homework ques or not a homework ques)…also ur ans is a comment…pls post it as a comment!!!

2 Likes