Program to swap the numbers by Call By Referance in C



#include
#include
main()
{
clrscr();
int a=10,b=20;
void swapr(int*,int*);
clrscr();
printf("\nEnter The Vale Of A & B:=");
scanf("%d%d",&a,&b);
printf("\n\t A=%d",a);
printf("\n\t B=%d",b);
swapr(a,b);
printf("\n\n\tAfter Sweping The Value");
printf("\n\n\t A=%d",a);
printf("\n\t B=%d",b);
getch();
}
void swapr(int,int)
int *x,*y;
{
int *z=0;
*z=*x;
*x=*y;
*y=*z;
}


Related Links :

Program to create rectangle


#include
main()
{
int driver,mode,i=10;
driver=0;
mode=VGAHI;
initgraph(&driver,&mode,"\\tc\\bgi");
for(i=10;i<=100;i+10)
{
rectangle(254,236,456,368);
clearviewpart();
delay(500);
moveto(i,i);
}
getch();
restorecrtmode();
closegraph();
}

Related Links :

Program to Show Pointer example by using %u


main()
{
int num[3];
int n,i,*j;
clrscr();
printf("enter the number:-");
scanf("%d",&n);
j=&num[0];
for(i=0;i<=n;i++)
{
printf("\naddress=%u",j);
printf("\n element=%d",i);
j++;
}
getch();
}

Related Links :

Program to calculate Total, Performance and average of given numbers in c



main()
{
int match1, match2, pr, tot;
clrscr();
printf("\n enter match1, match2");
scanf("%d %d", &match1,&match2);
tot=match1 + match2;
printf("\n total= %d", tot);
pr=tot/2;
printf("\n percentage=%d", pr);
if(pr> 100)
{
printf(" normal performance");
}
if(pr<50)
printf("\n Your Very bad");
getch();
}

Related Links :

Program to Frind the biggest and smallest number from given array set


main()
{
int array[]={5,66,76,34,23,51,94,18,35};
int i,count,large=1,small=32767,n;
clrscr();
for(count=0;count<=9;count++)
{
printf("\n %d-------> %d",count,array[count]);
}

for(count=0;count<=9;count++)
{
if(large < array[count])
{
large = array[count];

}
if(small >= array[count])
{
small=array[count];
}
}
printf("\n largest no in the array is %d",large);
printf("\n smallest no in the array is %d",small);
getch();
}


Related Links :


If you face any Problem in viewing code such as Incomplete "For Loops" or "Incorrect greater than or smaller" than equal to signs then please collect from My Web Site CLICK HERE


More Useful Topics...

 

History Of C..

In the beginning was Charles Babbage and his Analytical Engine, a machine
he built in 1822 that could be programmed to carry out different computations.
Move forward more than 100 years, where the U.S. government in
1942 used concepts from Babbage’s engine to create the ENIAC, the first
modern computer.
Meanwhile, over at the AT&T Bell Labs, in 1972 Dennis Ritchie was working
with two languages: B (for Bell) and BCPL (Basic Combined Programming
Language). Inspired by Pascal, Mr. Ritchie developed the C programming
language.

My 1st Program...


#include
#include
void main ()
{
clrscr ();
printf ("\n\n\n\n");
printf ("\t\t\t*******Pankaj *******\n");
printf ("\t\t\t********************************\n");
printf ("\t\t\t\"Life is Good...\"\n");
printf ("\t\t\t********************************");
getch ();
}

Next Step...


#include
#include

void main ()
{
clrscr ();
printf ("\n\n\n\n\n\n\n\n");
printf ("\t\t\t --------------------------- \n\n");

printf ("\t\t\t | IGCT, Info Computers, INDIA | \n\n");
printf ("\t\t\t --------------------------- ");

getch ();

}

Hits!!!