Recent Posts

Thursday 18 January 2018

C Program to swap two numbers

In the previous post we learnt about Program for addition of two numbers.In this post we learnt about  How to get two numbers and swap it
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter value of a and b");
scanf("%d%d",&a,&b);
c=a;
a=b;
b=c;
printf("after swapping a=%d\tb=%d",a,b);
getch();
}
Output:
Enter value of a and b : 5 7

after swapping:
a=7
b=5

0 comments:

Post a Comment

Followers

Popular Posts

Categories

social media

Text Widget

Powered by Blogger.

About Me

My name is junaid khan and i am a full time blogger and author of a blog tutorial called tutorialpointsolution.

String function

In the previous post we learn about what is String .we know that string is a collection of two or more characters.In string we can store al...

Search This Blog

Technology

Adbox

Recent Post

Breaking

Recent In Internet

Comments

Facebook

Pages

Comments

Pages

Recent

Pages

Technology