Assignment - 5: #Include
Assignment - 5: #Include
Assignment - 5: #Include
Q=Write a C program to read and print an Employee’s Details using Structure - You have to read
employee’s details like name, employee id and salary using a structure and then print the entered
values
#include <stdio.h>
int main() {
char id[10];
int hour;
scanf("%s", &id);
scanf("%d", &hour);
scanf("%lf", &value);
return 0;
#include<stdio.h>
/* Declaring Structure */
struct complex
float real;
float imaginary;
};
int main()
return 0;
#include <stdio.h>
#include <stdlib.h>
int main()
{
char str[1000];
FILE *fptr;
char fname[20]="test.txt";
#include <stdio.h>
#include <stdlib.h>
void main()
FILE *fptr;
char fname[20];
char str;
printf("------------------------------\n");
scanf("%s",fname);
if (fptr == NULL)
str = fgetc(fptr);
str = fgetc(fptr);
fclose(fptr);
printf("\n\n");
#include <stdio.h>
int main()
{
FILE *fptr;
int ctr = 0;
char fname[FSIZE];
char c;
printf("\n\n Read the file and count the number of lines :\n");
printf("--------------------------------------------------\n");
printf(" Input the file name to be opened : ");
scanf("%s",fname);