100% prog to copy contents of one structure variable to another variable of same structure
#include <stdio.h>
#include<stdlib.h>
void main()
{
struct employee
{
int service_years;
char name[17];
float salary; // after deducting tax
}e,duplicate; //to store three dates
printf("\n enter service years (integer), name (string without space) and salary (float):");
scanf("%d%s%f",&e.service_years,e.name,&e.salary);
duplicate=e;
printf("\n");
printf("\n\n service_years=%d \n name=%s \n salary=%f",duplicate.service_years,duplicate.name,duplicate.salary);
}
తెరమీద
enter service years (integer), name (string without space) and salary (float):4 vishNu 12324.50
service_years=4
name=vishNu
salary=12324.500000
enter service years (integer), name (string without space) and salary (float):4 vishNu 12324.50
service_years=4
name=vishNu
salary=12324.500000
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.