Answer:
#include <stdio.h>
#include <ctype.h>
void printHistogram(int counters[]) {
int largest = 0;
int row,i;
for (i = 0; i < 26; i++) {
if (counters[i] > largest) {
largest = counters[i];
}
}
for (row = largest; row > 0; row--) {
for (i = 0; i < 26; i++) {
if (counters[i] >= row) {
putchar(254);
}
else {
putchar(32);
}
putchar(32);
}
putchar('\n');
}
for (i = 0; i < 26; i++) {
putchar('a' + i);
putchar(32);
}
}
int main() {
int counters[26] = { 0 };
int i;
char c;
FILE* f;
fopen_s(&f, "story.txt", "r");
while (!feof(f)) {
c = tolower(fgetc(f));
if (c >= 'a' && c <= 'z') {
counters[c-'a']++;
}
}
for (i = 0; i < 26; i++) {
printf("%c was used %d times.\n", 'a'+i, counters[i]);
}
printf("\nHere is a histogram:\n");
printHistogram(counters);
}
Monitor
Printer
Headphones
Computer Speakers
Projector
GPS
Sound Card
Video Card
Braille Reader
Speech-Generating Device
Answer:
The answer to the given question can be given as:
The value of *iptr is 7. and the value of iptr is dynamic.
Explanation:
In the c++ code, it is defined that x is an integer variable that assigns a value which is 7. Then we define a pointer variable that is *iptr. This variable holds an address of the x variable. When we print the value of the iptr variable. if we use the expression *iptr to print value of the pointer variable by cout that is used in c++ for pint values. so the value of the iptr is 7. If we use the expression iptr sent to cout so we show the address of the variable x. In the pointer, it manages the addresses of dynamically allocated so the address of the variable is changed on execution time.
Answer:
n! = n*(n-1)*(n-2)*(n-3)* ... *2*1
Explanation:
The factorial operator is simply a mathematical expression of the product of a stated integer and all integers below that number down to 1. Consider these following examples:
4! = 4 * 3 * 2 * 1
4! = 12 * 2 * 1
4! = 24
6! = 6 * 5 * 4 * 3 * 2 * 1
6! = 30 * 4 * 3 * 2 * 1
6! = 120 * 3 * 2 * 1
6! = 360 * 2 * 1
6! = 720
So, the factorial of n would follow the same as such:
n! = n * (n-1) * (n-2) * ... * 2 * 1
Cheers.
Answer: Field-level briefing
Explanation: Field-level briefing is the brief description that is provided to the crew members or operation task holders.This briefing contains the information about the work and operation that are to be followed by the workers on the site .
Field level briefing is sort of instructions to individual or group of people who will be working with their assigned duties on the incident site.