write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / nagendra kumar
#include<stdio.h>
main(){
int a,b;
printf("Enter A value: ");
scanf("%d",&a);
printf("\nEnter B value: ");
scanf("%d",&b);
printf("\nThe value of A is:%d",a);
printf("\n The value of B is:%d",b);
a=(a+b)-(b=a);
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
}
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is union and structure?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
How can you allocate arrays or structures bigger than 64K?
What is action and transformation in spark?
How do you determine a file’s attributes?
formula to convert 2500mmh2o into m3/hr
What are the advantages of using macro in c language?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion
Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
Give me the code of in-order recursive and non-recursive.
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What are the advantages of using new operator as compared to the function malloc ()?
code for quick sort?
Explain how can I read and write comma-delimited text?