Program utilizing construction to retailer data of two staff (emp_id, title,wage) and show the main points of the worker having wage larger


              

Programmer's Academy

Code: 

#embrace <stdio.h>

struct worker

{

    char title[20];

    int  id;

    float wage;

};

int most important() {

struct worker e[10];

int i;

printf(“Particulars of Workern);

for(i=0;i<2;i++)

{

    printf(“Enter the worker Identify:”);

    scanf(%s,e[i].title);

    printf(“Enter the worker Id:”);

    scanf(%d,&e[i].id);

    printf(“Enter the worker Wage:”);

    scanf(%f,&e[i].wage);

    

}

   

 printf(“Particulars of Worker whose wage is larger:”);

 if(e[0].wage<e[1].wage)

 {

     printf(nWorker title:%snWorker Id:%dnWorker Wage:%f,e[1].title,e[1].id,e[1].wage);

 }

 else 

 {

    printf(nWorker title:%snWorker Id:%dnWorker Wage:%f,e[0].title,e[0].id,e[0].wage);

 

    

}

return 0;

}

Pattern Enter and Output:

Particulars of Worker

Enter the worker Identify:Pankaj

Enter the worker Id:12

Enter the worker Wage:84842

Enter the worker Identify:Siddhiraj

Enter the worker Id:13

Enter the worker Wage:94949

Particulars of Worker whose wage is larger:

Worker title:Siddhiraj

Worker Id:13

Worker Wage:94949.000000

 

For those who any have doubt,suggestion concerning this put up or web site then be at liberty to share with us.

 

When you have realized one thing new from this put up then share this put up with your loved ones and
associates.

 

Completely satisfied Studying :)?   

 

Earlier
Subsequent

(Visited 9 times, 1 visits today)

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
Ask ChatGPT
Set ChatGPT API key
Find your Secret API key in your ChatGPT User settings and paste it here to connect ChatGPT with your Tutor LMS website.
0
Would love your thoughts, please comment.x
()
x