write a function which accept two numbers from main() and
interchange them using pointers?
Answer Posted / amritpal singh
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b;
void swap(int *,int *); //Functioin Prototype
clrscr();
cout<<"\nEnter the number::\n";
cin>>a>>b;
cout<<"\nValues before INterchange are \na=<<" and \nb="<<b;
swap(&a,&b); //Functiion Calling
cout<<"\nValues after interchange\na=<<" and \nb="<<b;
getch();
}
void swap(int *a,int *b) //Function Defintioon
int temp;
temp=*a;
*a=*b;
*b=temp;
}
Thanks friends if any mistake pls coorect it by again urs
answer
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
what is the different bitween abap and abap-hr?
In which layer of the network datastructure format change is done
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
Why is c faster?
What is use of integral promotions in c?
How do I get an accurate error status return from system on ms-dos?
Why dont c comments nest?
Why does not c have an exponentiation operator?
Explain how do I determine whether a character is numeric, alphabetic, and so on?
Why is c known as a mother language?
Why do we use null pointer?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
How can I delete a file?