• Check out world news on HeadLinesList.com
  • Forum registration is now open for public.
Hello There, Guest! Login


Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Theory question in C programming?
#
1.Explain Call by value and Call by Reference with one programming example each.
2.Design a structure named employee to print names and nos. of employee who have 5 years or more experience and salary less than Rs.10000 using array of structure(Name , No, Experience and Salary as member.
3.Explain storage class with one example each.
4.Compare switch()control statement with if-else if

Ads

#
lol... u have too many questions to answer... try to read a book instead of posting here every thing u dont understand...
u can get the first ans on function chapter, 2nd on structure, dint actually understand ur 3rd ques, r u talking about data type? , forth on control statement/decision making...

Ads

#
None of those items are questions !
#
1.Explain Call by value and Call by Reference with one programming example each.
C does not have call by reference (that is a c++ thing) but it can be simulated
int my_funct(int x) { printf("%d",x); } // call by value
int my_funct_ref(int * x){printf("d",*x);}// simulate call by reference


2.Design a structure named employee to print names and nos. of employee who have 5 years or more experience and salary less than Rs.10000 using array of structure(Name , No, Experience and Salary as member.
I do not see a question here...

3.Explain storage class with one example each.
Storage class refers to the scope and duration of a variable
inside a function
int x; the variable's scope and life is only during the execution of the function.
static x; the variable is only visible in the function but keeps its value between function calls
outside a function (global) the variable is visible everywhere and lives as long as the programme is executing unless it is declared
static as in
static int x;
then it can only be seen in the translation unit that it is declared in.
4.Compare switch()control statement with if-else if

do not see a question here...

Ads

  


Forum Jump:


1 Guest(s)