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

Write the test cases for checking a variable having value in range -10.0 to +10.0?

1813


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

602


Does c have function or method?

584


What are the advantages of union?

624


How can you tell whether a program was compiled using c versus c++?

613






Which is best linux os?

556


What are the different types of linkage exist in c?

609


Explain spaghetti programming?

680


Why malloc is faster than calloc?

584


How can you find the day of the week given the date?

609


Explain setjmp()?

651


int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;

1119


What functions are used in dynamic memory allocation in c?

590


Is javascript written in c?

571


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1622