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
#include stdio.h> #include conio.h> #include string.h>   void main() {           char a[50],b[25][25],l[25],temp1;           int i=0,j=0,k=0,l1[25],c=0,c1=0,t=

If we take the input image and smooth it with a Gaussian of a significant size before computing the Canny edges does the number of edges change, and do the locations of these edges

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

We need an E Commerce site likefifacointrader. you must have experience with that kind of work You have to show a sample of work like that site. Skills required are C Prog

The question description: You are required to make a C++ program to conduct timber component (beam and column) structural design according to EC5 (all the relevant design codes

write a program that would accept the radius of the sphere and return its surface area.

¦It should ask customers to enter details such as their names and addresses. ¦It should print a welcome message that includes the customer’s name. ¦It should provide a list of avai

This is what I need help with. "Create a program creates an interface allowing the user to select from some other programs I have made one being a money converter and the other ca

Four cells, each with an internal resistance of 0.40 ? and an e.m.f. of 2.5 V are connected in series to a load of 38.40 ?. (a) Verify the current flowing in the circuit and t