C Programming Question and Answers

97. Can you pass an entire structure to functions?
  Yes, it is possible to pass an entire structure to a function in a call by method style. However, some programmers prefer declaring the structure globally, and then pass a variable of that structure type to a function. This method helps maintain consistency and uniformity in terms of arguments type.
 
Your Name Your Email-ID
Your Answer
98. What is the difference between top down approach and bottom up approach in programming languages?
 
  • Top down approach and bottom up approach are involved in software development. These approaches are not involved in program execution. Structure/procedure oriented programming languages like C programming language follows top down approach. Whereas object oriented programming languages like C++ and Java programming language follows bottom up approach.
  • Top down approach begins with high level design and ends with low level design or development. Whereas, bottom up approach begins with low level design or development and ends with high level design.
  • In top down approach, main() function is written first and all sub functions are called from main functions.
  • Then sub functions are written based on the requirements. Whereas, in bottom up approach, code is developed for modules and then these modules are integrated with main() function.
  • Nowadays, both approaches are combined together and followed in modern software design.
 
Your Name Your Email-ID
Your Answer
99. How do you convert strings to numbers in C?
  You can write you own functions to do string to number conversions, or instead use C's built in functions. You can use a to f to convert to a floating point value, a to i to convert to an integer value and a to l to convert to a long integer value.
 
Your Name Your Email-ID
Your Answer
100. What is the use of "goto" statement?
  goto statement is used to transfer the normal flow of a program to the specified in the program. Below is the syntax for goto statement in C.
{
……..
goto label;
……
…….
LABEL :
statements;
}
 
Your Name Your Email-ID
Your Answer