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                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
how to return 1000 variables from functio9n in c?plz give me
code also
 Question Submitted By :: Prasad237
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how to return 1000 variables from functio9n in c?plz give me code also
Answer
# 1
SEE /...  we cant return 1000 variables at a time ... using
call by value......  only call by reference can do it....
tat is. usage of pointers...... since it will change
directly in the address itself.... that's a specality...


#include<stdio.h>
#include<conio.h>
void fun(int *,int *,int *.............1000 int's );
void main()
{
int a1,b1,c1,d1,.............a1000;
fun(&a1,&a2,...... &a1000);
for(int i=0;i<1000;i++)
printf("\n %d",a1);
getch();
}
void fun(int *a1,int *b2,.......... 1000 ptr declarations)
{
*a1=1;
*a2=2
.
.
.
.
.
.
100th varaible =1000;
}
 
Is This Answer Correct ?    3 Yes 1 No
Vignesh1988i
 
  Re: how to return 1000 variables from functio9n in c?plz give me code also
Answer
# 2
extending the previous answer by passing array instead of
all variables
 
Is This Answer Correct ?    4 Yes 0 No
Codee
 
 
 
  Re: how to return 1000 variables from functio9n in c?plz give me code also
Answer
# 3
you r right sir.... but he has asked 1000 VARIABLES.. so
only i done in this way.....
 
Is This Answer Correct ?    0 Yes 2 No
Vignesh1988i
 
  Re: how to return 1000 variables from functio9n in c?plz give me code also
Answer
# 4
the first answer is quite long......

just pass an array(1000 elements) and return that.....
 
Is This Answer Correct ?    2 Yes 0 No
Mishra@deepa
 
  Re: how to return 1000 variables from functio9n in c?plz give me code also
Answer
# 5
#include<stdio.h>
int fun(int *a)
{
    return ++(*a);
}
     
int main()
{
    int a=0,i,d;
      for(i=0;i<100;i++)
      {
                       d=fun(&a);
                       printf("\n%d",d);
      }
    getch();
}
 
Is This Answer Correct ?    0 Yes 0 No
Ramachandran
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
two progs are given. one starts counting frm 0 to MAX and the other stars frm MAX to 0. which one executes fast. Verifone5
Write a function that accepts two numbers,say a and b and makes bth bit of a to 0.No other bits of a should get changed. Scientific-Atlanta2
Find string palindrome 10marks Honeywell5
Write a program to compare two strings without using the strcmp() function Accenture14
main() { int i=400,j=300; printf("%d..%d"); } ME8
write a 'c' program to sum the number of integer values  5
1. Write a c pgm to print 1 to 100 without using loops. 2. Write a c pgm for leap year 3. Write a c pgm fibbonacci series,factorial 4. Write a c pgm count no of lines , blanks, tabs in a para(File concept) 5. Write a c pgm to print the letter as per given condition i.e.. if u give 4 out put should b 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 6.how do get the o/p in number from 1 to 100 in the screen without using control statement? 7. who do u print the word "hello world" without using "printf" statement? 8. write sql program to get the detail of student in a class? Definitions: structure union arrays linkedlist macros directives difference b/w pre processorsDiffrence: 1.Constructors and destructors 2.Structure and Union 3.Array and Lists 4.pre processor... 5. Privillages in C++ 6.structure and union 7.break and continue 8.while and dowhile Pgm..  1
To find whether a number is even or odd without using any conditional operator?? IBM4
2. What is the function of ceil(X) defined in math.h do? A)It returns the value rounded down to the next lower integer B)it returns the value rounded up to the next higher integer C)the Next Higher Value D)the next lower value Accenture2
WAP to accept first name,middle name & last name of a student display its initials? NIIT2
what is the benefit of c30  1
plz answer.... write a program that reads line (using getline) e.g."345", converts each line to an integer using "atoi" and computes the average of all the numbers read. also compute the standard deviation.  1
What's wrong with "char *p = malloc(10);" ?  4
What is the main differences between C and Embedded C?  2
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?  1
What are Storage Classes in C ? HP15
what is difference between array and structure? TCS19
what is the difference between declaration and definition of a variable or function ?  2
Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks. Google3
How to receive strings with spaces in scanf()  4
 
For more C 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