C Language Archive
Nested for loop: Defining for loop inside another for loop. Using nested loops, we can process 2 dimensional data (rows & columns). Outer loop represents number of rows Inner loop represents number of columns. Output: …
goto: It is a keyword. It is a branching statement It is used to send the cursor from one location to another location in C program. Goto statements transfer the control using labels. Label is …
do-while loop: While : Check the condition and execute the block. Repeat loop as long as the condition is valid. Do-while: Execute the block for the first time without checking the condition. The Loop repetition …
Function: Function is block of instructions that performs a task. C Program execution starts with main() function. OS invokes main() function automatically to start the program. The prototype(syntax) of main() function as follows: The prototype …
Functions classified into: No arguments No return values With argument No return values With arguments With return values No argument with return values Recursion No arguments and No return values: In this case, the function …
Function takes arguments and return output: Write a function that returns factors count of given number: Even or Odd program by returns true or false value from function:
With arguments and No return values: We need to pass input values while calling the function. Input values are also called parameters. We declare variables(arguments) to collect these input values. Even number code using functions: …
Recursion: Function calling itself is called recursion. Calling the function from the definition of same function. Note: Every function in program executes from Stack memory. While executing the program, if the stack is full then …
Function arguments: Arguments of function working like local variables. Local variables can access only from the same function. Output this code: In function call, all arguments execute from right to left Output this code: Crack …
Code: Find the factorial using recursion: Print 1 to 10 numbers using recursion: Print 10 to 1 numbers using recursion: