how to swap two integers 1 and 32767 without using third
variable

Answer Posted / riya ganguly

int a=1,b=32767;
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How would you use the functions fseek(), freed(), fwrite() and ftell()?

692


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

575


What is variable initialization and why is it important?

609


How do we declare variables in c?

559


Write a program to reverse a given number in c?

585






What are data types in c language?

578


How to declare a variable?

560


Can a pointer be volatile in c?

527


HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????

2259


Where is c used?

641


What would be an example of a structure analogous to structure c?

568


What is array in c with example?

607


What are the two types of structure?

567


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

589


In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.

1370