PRF192_-_FA_2024_-_RE_3050.webp
H

PRF192_-_FA_2024_-_RE_3050.webp

Kizspy | Question: 50
(Choose 1 answer)
Consider the following program and answer the following questions.
#include<stdio.h>
void updatePosition(int *time, float* position, float v)
{ else *position += -0.1*(*position);time += 1;}
if ((*position < 5) && (*position > -5))*position += v;
main()
{ float p=4.0, v=1; int t=0; printf("t = %d, p = %f\n", t, p);updatePosition(&t, &p, v);updatePosition(&t, &p, v);printf("t = %d, p = %f\n", t, p);}
What is the result displayed to the screen?
A. t=0 p=4.000000 t = 2, p = 6.000000 B. t = 0, p=4.00000 t = 2, p = 5.000000
C. t=0, p = 4.000000 t=2, p=4.500000
D. \underline{t}=0 p=4.0000000 t=2, p=4.000000

Thông tin

Category
PRF192
Thêm bởi
hello_world1
Ngày thêm
Lượt xem
2,332
Lượt bình luận
7
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom