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
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 |
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 |
What are the different properties of variable number of arguments?
what is void pointer?
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above
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.
Is c dynamically typed?
writ a program to compare using strcmp VIVA and viva with its output.
what is c?
How do you construct an increment statement or decrement statement in C?
Eight queens puzzle
Can one function call another?
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
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"