Skip to main content

Posts

Showing posts from September, 2020
To Get All Information of Sarkari Jobs | Results | Admit Card | And courses ,Internships then CLICK HERE

Recursion In Function-:

  A function that called itself is known as recursive function and the process of calling function itself is known as Recursion. The default data structure used in recursion is STACK. Recursion works slower than loop. Recursion is more alignment few variable,which make program clean. It is hard to think a logic of recursive function it is also difficult to debug the code containing recursion. img credit:Google Images Example -: #include<stdio.h> #include<conio.h> main() {int num=0 res=0; printf("Enter the number"); scanf("%d".&num); res=fact_N(num); printf("\n Factorial of %d %d",num,res); getch(); } fact_N(intx) {int f=0; if(x==1) return1; else f=x*fact_N(x-1); returnf; }

Difference Between Call By Value And Call By Reference

 Call By Value And Call By Reference:- 1- Call By Value -:  In call by value each of the actual arguement in the calling function is copied to the formal arguement. The change made in the formal arguement have no effect on the values of actual arguement in calling function. 2-   Call By Reference -:  In call by reference the address of actual arguement in the calling function is copied to the formal arguement. The change made in the formal arguement, made change on the values of actual arguement in calling function. img credit: google image Example -: #include<stdio.h> #include<conio.h> main() {int x=0,y=0,res=0; printf("Enter the value of x and y:-"); scanf("%d %d ",&x,&y); printf("\n x=%d,y=%d"x,y); res= swap_value(intx,inty) printf("\n Now x=%d y=%d"x,y); getch(); } int swap_value(intx,inty) {int t=0; printf("\n here x=%d y=%d",x,y); t=x; x=y; y=t; printf("\n now x=%d t=%d y=%d",x,t,y); } Output -: Ente...

Download The Book "Let Us C" By Yashavant P.Kanetkar,Click The Below Button

-->Email Subscription

Enter Your Email Address:-

Delivered by FeedBurner

Copyright © 2020 TechProgramiz|All Right Reserved|Made By-: Sudarshan Pandey