31972162 2/courses/2185-INTERMEDIATE-PR address of a 0x7ffda2feee48 address of a
ID: 3914881 • Letter: 3
Question
31972162 2/courses/2185-INTERMEDIATE-PR address of a 0x7ffda2feee48 address of ab 0x7fda2feee4c address of abc 0x7ffda2feee47 Using & and operator: value at address of a 50 value at address of ab 20.10 value at address of abc 's' Task 2 (20 pts.) In a file called task2.c, write a C program to do the following with pointer 1) Declare an array of pointers named alpha of 15 components of type int 2) Output the value of the 12th component of the alpha. 3) Set the value of the 5th component of the alpha to 22. 4) Set the value of the 9th component of the alpha to the sum of the 7th and 14th components of the alpha. 5) Set the value of the 3rd component of the alpha to four times the value of the 9th component minus 33. 6) Output alpha so that three (3) components appear on each line. Task 3 (15 pts.) In a file called task3.c, write function has three inputs which are integers. The function returns true if raised a C program (using a Function and Pointers) that the the first number to the power of the second number equals the third number. Example MacBook AirExplanation / Answer
#include <stdio.h>
#include <malloc.h>
int main() {
// 1
int *alpha = malloc(sizeof(int) * 15);
// 2
printf("%d", alpha[11]);
// 3
alpha[4] = 22;
// 4
alpha[8] = alpha[6] + alpha[13];
// 5
alpha[2] = 4*alpha[8] - 33;
// 6
int i=0;
for(i = 0; i < 15; ++i) {
printf("%d ", alpha[i]);
if((i+1) % 3 == 0) {
printf(" ");
}
}
return 0;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.