Â
#include <stdio.h>
union phone
{
char name[30];
int price;
};
int main()
{
union phone nokia, lenovo;
printf("Enter Nokia Mobile's name and price \n");
scanf("%s", &nokia.name);
scanf("%d", &nokia.price);
printf("Enter Lenovo Mobile's name and price \n");
scanf("%s", &lenovo.name);
scanf("%d", &lenovo.name);
printf("%s %d", nokia.name, nokia.price);
printf("%s %d", lenovo.name, lenovo.price);
return 0;
}
//.........Coded by ARADHANA MISHRA
#ENJOY CODING
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP