CProgram

# Swap Values of Two Variables

Write a Program to Swap Values of Two Variables Without using 3rd Variable.

/*Program to Swap Values of Two Variables Without using 3rd Variable*/
#include <stdio.h>
main()
{
int a, b, temp;
printf(“\nEnter any two numbers: “);
scanf(“%d %d”, &a, &b);
printf(“\n\nBefore Swapping:\n”);
printf(“\na = %d\n”, a);
printf(“\nb = %d\n”, b);
a = a + b;
b = a – b;
a = a – b;
printf(“\n\nAfter Swapping:\n”);
printf(“\na = %d\n”, a);
printf(“\nb = %d\n”, b);
getch();
}

Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0

C

C

C

### Reverse the order of each word of the string using pointers

Write a C program to reverse the order of each word of the string using ...

### Convert temperature from degree centigrade to Fahrenheit

Write a C program to convert temperature from degrees Centigrade to Fahrenheit. #include<stdio.h> int main() { float celsius, fahrenheit; ...

### Program to find Average of three Real Numbers

Write a C program to an average of three real numbers. #include <stdio.h> main() { ...

### Find Area of Square & Circumference of a Circle

Write a C program to find the area of a square & circumference of a ...