How to write in a function declaration and in function call in
which the function has 'n' number of varible or arguments?

Answer Posted / aravind

#include<stdio.h>
int example(int );/*function prototype*/
int main()
{
int a[4]={1,2,3,4,5},i;
example(a[0]);/*function call*/
printf("a=%d",a[i]);
}
int example(int b[k])/*function defintion*/
{
int j;
for(j=0;j<=4;j++)
printf("%d",b[j]);
}
/*here i took n=4*/

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why pointers are used in c?

592


Explain what is a program flowchart and explain how does it help in writing a program?

650


Difference between MAC vs. IP Addressing

643


What are variables c?

623


What is the use of putchar function?

652






i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me

1481


What are all different types of pointers in c?

580


The statement, int(*x[]) () what does in indicate?

648


What is function what are the types of function?

561


Explain a file operation in C with an example.

664


What is a macro in c preprocessor?

632


What will be the outcome of the following conditional statement if the value of variable s is 10?

768


what is the c source code for the below output? 10 10 10 10 10 10 10 10 10 10 9 9 7 6 6 6 6 6 6 9 7 5 9 7 3 2 2 5 9 7 3 1 5 9 7 3 5 9 7 4 4 4 4 5 9 7 8 8 8 8 8 8 8 8 9

1431


What is a pointer variable in c language?

646


What is the purpose of 'register' keyword in c language?

630