Question 6

Consider the following C code segment:
#include <stdio.h>
main()
{
int i, j, x;
scanf("%d", &x);
i = 1; j = 1;
while(1 < 10){
j = j * i;
i = i + 1;
if(i == x)break;
}

}
For the program fragment above, which of the following statements about the variables i and j must be true after execution of this program? [ !(exclamation) sign denotes factorial in the answer ]


Create a FREE account and get:

  • Download Maths Shortcuts PDF
  • Get 300+ previous papers with solutions PDF
  • 500+ Online Tests for Free

cracku

Boost your Prep!

Download App