Professional Documents
Culture Documents
Answer 1:
#include <stdio.h>
int main() {
int r = 3, c = 3;
float quotient[100][100];
scanf("%d", &a[i][j]);
scanf("%d", &b[i][j]);
}
// adding two matrices
if (j == c-1) {
printf("\n\n");
if (j == c-1) {
printf("\n\n");
}
}
if (j == c-1) {
printf("\n\n");
if (j == c-1) {
printf("\n\n");
}
return 0;
}
Answer 2
#include <stdio.h>
// structure declaration
struct student {
int roll;
char name[50];
int sem;
char course[50];
char address[100];
float fees;
};
int main() {
int i, n;
scanf("%d", &n);
studentInfo(s, n);
printf("\nDisplaying information:\n\n");
// displaying information
}
return 0;
int i;
// storing information
s[i].roll = i + 1;
scanf("%s", s[i].name);
scanf("%d", &s[i].sem);
scanf("%s", &s[i].course);
scanf("%s", &s[i].address);
scanf("%d", &s[i].contact);
scanf("%f", &s[i].fees);
}
Answer 3
#include <stdio.h>
int main() {
return 0;
Answer 4
#include <stdio.h>
#include <time.h>
struct Employee {
char name[100];
int dept_no;
char dept_name[100];
char designation[100];
// nested structure
struct Date {
int day;
int month;
int year;
} dob, doj;
};
int main() {
time_t t = time(NULL);
//localtime() function
struct tm tm = *localtime(&t);
scanf("%s", emp.name);
scanf("%d", &emp.dept_no);
scanf("%s", emp.dept_name);
scanf("%s", emp.designation);
// Calculate age
age--;
start_tm.tm_mon = emp.doj.month - 1;
start_tm.tm_mday = emp.doj.day;
return 0;
Answer 5
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct Employee {
char name[100];
int dept_no;
char dept_name[100];
char designation[100];
union {
float yearly_salary;
} salary;
struct Date {
int day;
int month;
int year;
} dob, doj;
};
int main() {
int i, n;
scanf("%d", &n);
printf("Name: ");
scanf("%s", emp[i].name);
scanf("%d", &emp[i].dept_no);
printf("Designation: ");
scanf("%s", emp[i].designation);
scanf("%f", &emp[i].salary.yearly_salary);
highest_salary = emp[i].salary.yearly_salary;
// displaying information
printf("\nEmployee details:\n");