ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Code Snippets  >>  Programming Code  >>  C Code
 
 


 

 
 C Code interview questions  C Code Interview Questions
 C++ Code interview questions  C++ Code Interview Questions
 VC++ Code interview questions  VC++ Code Interview Questions
 Java Code interview questions  Java Code Interview Questions
 Dot Net Code interview questions  Dot Net Code Interview Questions
 Visual Basic Code interview questions  Visual Basic Code Interview Questions
 Programming Code AllOther interview questions  Programming Code AllOther Interview Questions
Question
how to return a multiple value from a function?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to return a multiple value from a function?
Answer
# 1
using call by refernce
 
Is This Answer Correct ?    3 Yes 0 No
Chandu
 
  Re: how to return a multiple value from a function?
Answer
# 2
use call by refrance..-> pointers.
 
Is This Answer Correct ?    0 Yes 0 No
Shruti
 
 
 
  Re: how to return a multiple value from a function?
Answer
# 3
using if else statement
for example
int fun()
{
if(cond1)
return var1;
else
return var2;

}
 
Is This Answer Correct ?    0 Yes 4 No
Vinayakkatkar
 
  Re: how to return a multiple value from a function?
Answer
# 4
string f()
{
   return "a multiple value"; 
}

:) if this a trick question ...
 
Is This Answer Correct ?    0 Yes 1 No
Ara
 
  Re: how to return a multiple value from a function?
Answer
# 5
#include<stdio.h>
#define PI 3.1415
int main()
{
  double area,perimeter,radius;
  printf("Enter radius of Circle:");
  scanf("%lf",$radius);
  calculate(&area,&perimeter,radius);
  printf("Area of Circle:%lf\nPerimeter of
Circle:%lf",area,perimeter);
}
calculate(double *a,double *p,double r)
{
  *a=PI*r*r;
  *p=2*PI*r;
}
 
Is This Answer Correct ?    1 Yes 0 No
Yogesh
 

 
 
 
Other C Code Interview Questions
 
  Question Asked @ Answers
 
void main() { int i=5; printf("%d",i+++++i); }  1
int i; main(){ int t; for ( t=4;scanf("%d",&i)-t;printf("%d\n",i)) printf("%d--",t--); } // If the inputs are 0,1,2,3 find the o/p  1
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution) Microsoft5
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }  1
void ( * abc( int, void ( *def) () ) ) ();  1
void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(“%d”,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(“%d”,*cptr); }  1
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }  1
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }  1
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }  1
Program to Delete an element from a doubly linked list. Infosys4
How to reverse a String without using C functions ? Wipro14
void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }  1
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }  1
program to Reverse a linked list Ness-Technologies4
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above HCL1
main() { int x=5; for(;x!=0;x--) { printf("x=%d\n", x--); } } a. 5, 4, 3, 2,1 b. 4, 3, 2, 1, 0 c. 5, 3, 1 d. none of the above HCL1
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }  1
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }  1
Derive expression for converting RGB color parameters to HSV values  1
struct Foo { char *pName; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); strcpy(obj->pName,"Your Name"); printf("%s", obj->pName); } a. Your Name b. compile error c. Name d. Runtime error HCL1
 
For more C Code Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com