Computer Science, asked by chaudharysahab94, 5 months ago

Write a program to input two characters and interchange their values.​

Answers

Answered by piyush112369
0

#include<stdio.h>

int main() {

double first, second, temp;

printf("Enter first number: ");

scanf("%lf", &first);

printf("Enter second number: ");

scanf("%lf", &second);

// Value of first is assigned to temp

temp = first;

// Value of second is assigned to first

first = second;

// Value of temp (initial value of first) is assigned to second

second = temp;

printf("\nAfter swapping, firstNumber = %.2lf\n", first);

printf("After swapping, secondNumber = %.2lf", second);

return 0;

Answered by Anonymous
1

Answer:

hello,

its a python program

Explanation:

#program to input two characters and interchange their values.

a=int(input("enter the first number"))

b=int(input("enter the second number"))

print("before interchanging")

print("a=",a,"b=",b)

print("after interchanging")

print("a=",b,"b=",a)

hope it helps you

please mark brainliest

@ItzSnowySecret07

Similar questions