You have to pass the address of the variables.
void swap (int *pa, int *pb)
{
...
}
i need this answer
The required c program is given below /*Swapping(interchange) the two entered numbers*/ #include<stdio.h> main() { /*Without using third variable*/ int a,b,t; printf("Enter a:"); scanf("%d",&a); printf("Enter b:"); scanf("%d",&b); a=a+b; b=a-b; a=a-b; printf("\n After swapping without using third variable"); printf("\na=%d\nb=%d",a,b); }
program to find maximum of two numbers using pointers
Using toString() method
A program which is used to count the number of numbers in an array using a 8085 microprocessor is known as a assembly language program.
The best method is to add the numbers, using arithmetic.
To swap two numbers N1 and N2, using a third variable T... T = N1; N1 = N2; N2 = T;
by using the Gamma method apparently...:)
Declaring a method is when you code for what the method will perform. When you call a method, you are using the method you have written in another part of the program, (or inside the method if it is recursive).
Scienctific method
To write a C++ program to display the student details using class and array of object.
binary system