Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of c program #406

Open
victor48-ux opened this issue Jun 29, 2023 · 3 comments
Open

Example of c program #406

victor48-ux opened this issue Jun 29, 2023 · 3 comments

Comments

@victor48-ux
Copy link

No description provided.

@deepak4566
Copy link

deepak4566 commented Jul 14, 2023

Fixes #406
C program for swapping of two numbers

#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;

// %.2lf displays number up to 2 decimal points

printf("\nAfter swapping, first number = %.2lf\n", first);
printf("After swapping, second number = %.2lf", second);
return 0;
}

@deepak4566
Copy link

This swaps the two numbers

@HARSHITHASALADI1
Copy link

can I work on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants