write a program to swap Two numbers without using temp variable.
Answer Posted / rakesh
#include<stdio.h>
#include<conio.h>
void main()
{
int a=10,b=8;
a=a+b;//a=10+8=18
b=a-b;//b=18-8=10
a=a-b;//a=18-10=8
//hence a=8,b=10
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the difference between printf and scanf )?
Who invented b language?
Create a structure to specify data on students as given below: Roll number, Name, Department, Course, and Year of joining. Assume that there are not more than 450 students in the collage. (a) Write a function to print the names of all students who joined in the last 3 years. (b) Write a function to print the data of a student whose roll numbers are divisible by 4.
Can 'this' pointer by used in the constructor?
Combinations of fibanocci prime series
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
Can you please explain the difference between strcpy() and memcpy() function?
What is a c token and types of c tokens?
What is clrscr in c?
Is that possible to store 32768 in an int data type variable?
What is function prototype in c language?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
What is infinite loop?
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); }
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.