C program to demonstrate call by reference, C/C++ Programming

C program to demonstrate call by reference:

void disp(int *,int*,int*,int*);

void main()

{

                int a=2,b=3, sum,mul;

                printf("Enter 1st no:\n");

                scanf("%d",&a);

                printf("Enter 2nd no:\n");

                scanf("%d",&b);

                disp(&a,&b,&sum,&mul);

                printf("\nsum=%d",sum);

                printf("\nMultiplication=%d",mul);

                getch();

}

void disp(int *x,int*y,int *s,int *m)

{

                *s=*x+*y;

                *m=(*x)*(*y);

}

Output:

772_call by reference.png

Posted Date: 9/29/2012 6:56:49 AM | Location : United States







Related Discussions:- C program to demonstrate call by reference, Assignment Help, Ask Question on C program to demonstrate call by reference, Get Answer, Expert's Help, C program to demonstrate call by reference Discussions

Write discussion on C program to demonstrate call by reference
Your posts are moderated
Related Questions
programing code on board coloring in clanguage


C program to print fibonacci series: int fibo(long int); void main() {                 long int a=0,n;                 printf ("how many terms\n");

explain Storage management: free storage pool, garbage collection, compaction, boundary tag method; Hash tables and hashing functions


Define the Bitwise-Exclusive-OR Operator: ^: The bitwise-exclusive-OR operator (^) compares every bit of its first operand to the corresponding bit of its second operand. If on

#C Why don''t online compilers support the header file? What can I do to resolve this? PS. I have tried , does''nt work either. Thannk in advance.

pls give me answer 01110-00110 in 2''s comlpiment in detail

Use the above problem and have the program print the biggest and smallest sales for each employee for everyday of the month. Program should also find the largest and

create algorithm for doubly link list using c data structure