Topic-28:Operations Of Array
The basic operation of an array is: Traversal Insertion Deletion Searching Sorting Merging Find min and max Find Duplicate element Find 2nd largest number Matrix operation
Topic-28:Operations Of Array Read More »
Your blog category
The basic operation of an array is: Traversal Insertion Deletion Searching Sorting Merging Find min and max Find Duplicate element Find 2nd largest number Matrix operation
Topic-28:Operations Of Array Read More »
What is the requirement of an array? To overcome the disadvantages of variable we will use array . What is the disadvantages of variable ? The disadvantages of array is variable cant not hold multiple value at a time , means one variable can hold only one value at a time . What is Array?
Types Of Recursion: Direct Recursion Indirect recursion Tail Recursion Non-Tail Recursion Linear and Tree Recursion 1.Direct Recursion: If a function calls the same function again is called as direct recursion . int fun(){ //Statement fun(); } Code: #include<stdio.h> int fun(int n){ if(n==0) { return n; } printf(“%dn”,n); return fun(n-1); } int main() { fun(5); return
Topic-26: Types of recursion Read More »
Fibonacci: Fibonacci Series is the pattern of numbers where result is calculated based on the addition of previous two terms . Code: #include<stdio.h> int fib(int n) { if(n<=1) { return n; } return fib(n-1)+fib(n-2); } int main() { int result; result=fib(3); printf(“the result is %d”,result); return 0; } Output: the result is 2
Topic-25: Fibonacci Series using Recursion Read More »
Defination: A function calls itself is called recursion . Find out the factorial of a number using recursion : Factorial: In mathematics , the factorial of a non-negative integer n , is denoted by n ! . The factorial of a number is the multiplication of all the integer from n to 1 . Code:
Topic-24 : Recursion Read More »
With argument with return type(WAWR): A “with argument, with return type” function is a type of function in programming that takes one or more arguments as input and returns a value upon execution. Here’s the definition syntax for a with argument, with return type function in C: return_type function_name(data_type parameter1, data_type parameter2, …) { //
With argument no return type(WANR): A “with argument, no return type” function is a type of function in programming that takes one or more arguments as input but does not return any value upon execution. Here’s the definition syntax for a with argument, no return type function in C: void function_name(data_type parameter1, data_type parameter2, …)
No argument with return type(NAWR): A “no argument with return type” function is a type of function in programming that does not take any arguments but returns a value upon execution. Here’s the definition syntax for a no argument with return type function in C: return_type function_name() { // Function body – code block where
No argument no return type(NANR): A “no argument, no return type” function, also known as a void function with no parameters, is a type of function in programming that does not take any arguments and does not return any value. Here’s the definition syntax for a no argument no return type function in C: void
Types Of Function: There are 2 types of functions are present . Predefined function [Build in function] User Defined Function What is pre-defined function ? Those functions which are already available in c language such type of functions are known as predefined function . Predefined function means we can call those functions directly . EX:-
Topic-19: Types Of Function Read More »