PRF192_-_SP_2025_-_Block_5_-_2_3869.webp
AllMight90

PRF192_-_SP_2025_-_Block_5_-_2_3869.webp

Kizspy Question: 30
(Choose 1 answer)
pjevsil Law Job
Consider the following program and answer the following questions.
#include<stdio.h>
void updatePosition(int *time, float* position, float v)
{
if ((*position <5) && (*position > -5))
*position += v;
else
*position +-0.1*(*position);
time += 1;
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.000000
t 2, p 5.000000
C. t 0, p 4.000000
t 2, p 4.500000
D. t 0, p 4.000000
t 2, p 4.000000

Thông tin

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

Share this media

Back
Bên trên Bottom