Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Unit-4

Structures, Unions and Files


Find the output:
#include<stdio.h>
struct tag
{
int a;
float b;
}v1,v2;
int main()
{
v1.a=10;
v1.b=15.5;
printf("%d %f\n",v1.a,v1.b);
v2=v1;
printf("%d %f\n",v2.a,v2.b);
return 0;
}
Find the output:
#include<stdio.h>
struct tag
{
int a;
float b;
}v1,v2;
int main() Output:
{ 10 15.5000
v1.a=10; 10 15.5000
v1.b=15.5;
printf("%d %f\n",v1.a,v1.b);
v2=v1;
printf("%d %f\n",v2.a,v2.b);
return 0;
}

You might also like