Uploaded by sahoosouvik449

Assignment

advertisement
1|Page
Assignment 1:
Problem Statement : Write a program to swap between two numbers.
Source Code :
// Swapping
#include<stdio.h>
#include<conio.h>
void main(){
int x,y,t;
clrscr();
printf("\n\n\t\tEnter the value of x .....");
scanf("%d",&x);
printf("\n\n\t\tEnter the value of y .....");
scanf("%d",&y);
printf("\n\n\t\tBefore swapping !!!!");
printf("\n\n\t\tx = %d, y = %d ....",x,y);
t = x;
x = y;
y = t;
printf("\n\n\t\tAfter swapping !!!!");
printf("\n\n\t\tx = %d, y = %d ....",x,y);
getch();
}
Result :
Date : 11/08/2023
2|Page
Teacher’s Signature : ___________________________________________________
3|Page
Assignment 2:
Download