write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / samruthi
#include<stdio.h>
void main()
{
int a=5,b=10;
printf("The value of A is:%d",a);
printf("\n The value of B is:%d",b);
b=a;
a=b;
a=b+a;
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
getch();
}
| Is This Answer Correct ? | 10 Yes | 7 No |
Post New Answer View All Answers
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What is scope and lifetime of a variable in c?
What is the scope of local variable in c?
Why header file is used in c?
How can I implement a delay, or time a users response, with sub-second resolution?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is meant by type specifiers?
Explain why c is faster than c++?
What is an array in c?
How can you tell whether a program was compiled using c versus c++?
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
What is the use of #include in c?