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

Answers were Sorted based on User's Feedback



How to write in a function declaration and in function call in which the function has 'n'..

Answer / kiran kumar yakkala

returntype function_name(int counter,...)

here first one is the counter tells about how many no are
going to use
... specifies variable no of arguments

for further clarificaiton, refer "Let us C" book

Is This Answer Correct ?    0 Yes 0 No

How to write in a function declaration and in function call in which the function has 'n'..

Answer / 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

More C Interview Questions

What is the use of getch ()?

0 Answers  


Does c have function or method?

0 Answers  


What is the best style for code layout in c?

0 Answers  


enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above

8 Answers   HCL, Wipro,


Is it valid to address one element beyond the end of an array?

0 Answers  






What is the difference between the local variable and global variable in c?

0 Answers  


Why c is procedure oriented?

0 Answers  


Give the output for the following program. #define STYLE1 char main() { typedef char STYLE2; STYLE1 x; STYLE2 y; clrscr(); x=255; y=255; printf("%d %d\n",x,y); }

2 Answers   ADITI,


What is difference between far and near pointers?

0 Answers  


What are the different file extensions involved when programming in C?

0 Answers  


How do you write a program which produces its own source code as its output?

4 Answers  


what is the use of operator ^ in C ? and how it works?

2 Answers  


Categories