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 are the different properties of variable number of arguments?

0 Answers  


what is void pointer?

2 Answers  


Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above

5 Answers   Accenture, TCS,


4.weight conversion: Write a program that will read weight in pounds and convert it into grams.print both the original weight and the converted value.There are 454 grams in a pound.design and carry out a test plan for this program.

1 Answers   Wipro,


Is c dynamically typed?

0 Answers  






writ a program to compare using strcmp VIVA and viva with its output.

0 Answers  


what is c?

4 Answers   IBM, TCS,


How do you construct an increment statement or decrement statement in C?

0 Answers  


Eight queens puzzle

0 Answers  


Can one function call another?

0 Answers  


Which of the following is not a valid declaration for main ()? 1) int main() 2) int main(int argc, char *argv[]) 3) They both work

2 Answers  


Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We.....Are....Student “ Note: one .=1 Space Output: "We Are Student"

6 Answers   IBM,


Categories