write a program in C to swap two variables
Answer Posted / r.aruna
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter the a value");
scanf("%d",&a);
printf("Enter the b value");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("After swapping a,b value",a,b);
getch();
}
Is This Answer Correct ? | 11 Yes | 3 No |
Post New Answer View All Answers
Explain what are multibyte characters?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
What is character set?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is main () in c?
What does a pointer variable always consist of?
How many types of sorting are there in c?
Why can arithmetic operations not be performed on void pointers?
What is anagram in c?
how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.
Why is it important to memset a variable, immediately after allocating memory to it ?
int far *near * p; means
What does do in c?
What is ponter?
What are the features of the c language?