write a program to swap Two numbers without using temp variable.
Answer Posted / ravi saini
void main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=a^=b;
printf("%d%d",a,b);//swapped no
}
Is This Answer Correct ? | 119 Yes | 66 No |
Post New Answer View All Answers
What are run-time errors?
How to write a multi-statement macro?
Write a program to swap two numbers without using a temporary variable?
Why is void main used?
which is conditional construct a) if statement b) switch statement c) while/for d) goto
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Explain about block scope in c?
How many types of operators are there in c?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What is function pointer c?
Why doesnt long int work?
why return type of main is not necessary in linux
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
What do you mean by command line argument?
Explain what is wrong with this program statement? Void = 10;