Santosh
Santosh
Practical -1
210470107055
int main()
{
int a,b,temp;
printf("enter two number");
scanf("%d %d",&a,&b);
swap(a,b);
return 0;
}
output
output
enter two number:
23
36
before swapping a=23 b=36
after swaaping a=36 b=23
Output
Data structure
Practical -1
210470107055
Enter the first 5 elements:
2
7
3
9
4
Sum of 5 elements: 25
Enter the next 5 elements:
4
8
2
8
3
Sum of 10 elements: 50
#include<stdio.h>
#include<string.h>
struct cricketar
{
Data structure
Practical -1
210470107055
int runs;
char name[25];
char teamname[25];
}
player[50],t;
int main()
{
int i,j,n=3;
printf("enter palyer name ,team name,runs\n");
for(i=0;i<n;i++)
{
scanf("%s %s %d",&player[i].name,&player[i].teamname,&player[i].runs);
}
for(i=0;i<n;i++)
{#include<stdio.h>
#include<string.h>
struct cricketar
{
int runs;
char name[25];
char teamname[25];
}
player[50],t;
int main()
{
int i,j,n=3;
printf("enter palyer name ,team name,runs\n");
for(i=0;i<n;i++)
{
scanf("%s %s %d",&player[i].name,&player[i].teamname,&player[i].runs);
}
for(i=0;i<n;i++)
{
for(j=0;j<n-1;j++)
{
if(player[j].runs>player[j+1].runs)
{s
t=player[j];
player[j]=player[j+1];
Data structure
Practical -1
210470107055
player[j+1]=t;
}
}
printf("\n");
for(i=0;i<3;i++){
for(j=0;j<n-1;j++)
{
if(player[j].runs>player[j+1].runs)
{
t=player[j];
player[j]=player[j+1];
player[j+1]=t;
}
}
printf("\n");
for(i=0;i<3;i++){
Output
jeni nz 30
mishi india 40
nisha india 45
#include<stdio.h>
else if (2 == '-')
{
printf("subtraction of the number=",a-b);
}
else ()
{
printf("invalid number");
}
}
void main()
{
double a,b;
int n;
cal( a,b,n);
}
Data structure
Practical -1
210470107055
output