ition to the following codes 3-20 pts) a)-Add the missing s struct Student jane
ID: 3903442 • Letter: I
Question
ition to the following codes 3-20 pts) a)-Add the missing s struct Student jane (1001, "Jane", 'A'): printfi "ID: %din", janell); printf "Name: %sin'',jane.Name); printfi..Grade: %eln", Jane-Grade); (b)- Assume array al ] saved at starting address 0x 1000. Write all the print outs. #include float al ] (10.0, 5.0, 5.0, 15.0,9.0), bl2]-(3.5, 6.2,2.1), *r, q, p void main(void) printfi.'Loc2% pin', p); r-?? Loc= be ? (c)- Write output as a result of the call fun(17) from main. void fun( int i) {printf"%d", i%3); fun(i/3);)Explanation / Answer
c.#include<stdio.h>
void fun(int i)
{printf("%d",i%3);
if(i>0)
fun(i/3);
}
int main()
{
fun(17);
return 0;
}
output: 2210
b.#include<stdio.h>
float a[]={10.0,5.0,5.0,15.0,9.0};
float b[2]={3.5,6.2,2,1};
float *r,*q,*p;
void main(void)
{
p=&a[1];
printf("loc=%p ",p);
q=&a[4];
r=&b[1];
printf("a=%f b=%f ", *q,*r);
r--;
p++;
printf("c=%f d=%f",*r,*p);
}
output:
a.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.