Answer:
#include<stdio.h>
#include<string.h>
int main() {
int n;
FILE *fp = fopen("salaries.txt", "r");
double sumSalaries = 0;
double quarterlySalary1, quarterlySalary2, quarterlySalary3, quarterlySalary4;
while(!feof(fp)) {
fscanf(fp, "%lf", &quarterlySalary1);
fscanf(fp, "%lf", &quarterlySalary2);
fscanf(fp, "%lf", &quarterlySalary3);
fscanf(fp, "%lf", &quarterlySalary4);
sumSalaries = sumSalaries + quarterlySalary1+quarterlySalary2+quarterlySalary3+quarterlySalary4;
printf("Salary Sum %lf: \n", sumSalaries);
printf("Income Type: ");
if(sumSalaries > 200000 ){
printf("h");
}
else if(sumSalaries >= 15000 && sumSalaries<=200000){
printf("m");
}
else{
printf("l");
}
printf("\n");
}
fclose(fp);
return 0;
}
Explanation:
Crime rate
unemployment
fluctuations
suspension of terrorism
Answer:
it would show What is your name? on the screen and you would be able to input your name
Explanation:
Answer:
To do this you'll need to use malloc to assign memory to the pointers used. You'll also need to use free to unassign that memory at the end of the program using the free. Both of these are in stdlib.h.
#include <stdlib.h>
#include <stdio.h>
#define SIZE_X 3
#define SIZE_Y 4
int main(void){
int **matrix, i, j;
// allocate the memory
matrix = (int**)malloc(SIZE_X * sizeof(int*));
for(i = 0; i < SIZE_X; i++){
matrix[i] = (int *)malloc(SIZE_Y * sizeof(int));
}
// assign the values
for(i = 0; i < SIZE_X; i++){
for(j = 0; j < SIZE_Y; j++){
matrix[i][j] = SIZE_Y * i + j + 1;
}
}
// print it out
for(i = 0; i < SIZE_X; i++){
for(j = 0; j < SIZE_X; j++){
printf("%d, %d: %d\n", i, j, matrix[i][j]);
}
}
// free the memory
for(i = 0; i < SIZE_X; i++){
free(matrix[i]);
}
free(matrix);
return 0;
}
Answer: B
Explanation:
Conventions include spelling, punctuation, capitalization, grammar, and sentence structure.