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

Describe newline escape sequence with a sample program?

0 Answers  


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

0 Answers  


If input is 123 then how to print 100 and 20 and 3 seperately?

4 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers  


How to avoid structure padding in C?

8 Answers   Tech Mahindra,


what is the hardware model of CFG( context free grammar)

0 Answers   Microsoft,


What is character constants?

0 Answers  


Efficient data structure for store/search list of 1000 records a)array b)double linked list c)circular queue d)hash table

3 Answers   Value Labs,


What does c mean in standard form?

0 Answers  


What are the 32 keywords in c?

0 Answers  


Write a program to check palindrome number in c programming?

0 Answers  


Why c is called object oriented language?

0 Answers  


Categories