Distinguishing if-else and conditional operators


1.a. With the help of suitable example distinguish between given control statements:

(i) if-else
(ii) conditional operators

b. Consider the following program

void main()
{
char name[30];
float balance;
FILE *fptr;
fptr = fopen(“clients.txt”,”w”);
printf(“Enter name and balance.\n ”);
printf(“Enter EOF to end input.\n ”);
do
{
printf(“? ”);
scanf(“%s%f”, name, &balance);
fprintf(fptr,”%s%f\n”, name, balance );
}while(!feof(stdin));
}
fclose(fptr);
}

Describe the functions given below referring to the above program:

(a) fopen()
(b) fclose()
(c) fprintf()

Alter fopen() to make it add new information at the end of the file.

(c) Using structures write down a program in C to input given information about employees in the company X.

(i) Family name
(ii) First name
(iii) Identification number
(iv) Date of birth
(v) Position
(vi) Salary

The number of employees must be input by the user. Your program must be able to show the details about the employees

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Distinguishing if-else and conditional operators
Reference No:- TGS09257

Expected delivery within 24 Hours