0:17 AM 2007-2008 question 6 |
correct
include stdio
main
i;j;val1;val2:int
val1 == 0
for(i<=,i==1,i=+2)
{
val2==1
for(j<=i,j==1,j+)
val2 =*j
val1=+val2
}
printf " value = f% ";val1
}
answer
#include"stdio.h"
main()
{
int i, j, val1, val2;
val1=0;
for(i=1;i<=5;i+=2){
val2=1;
for(j=1;j<=i;j++)
val2*=j;
val1+=val2;
}
printf("value = %d", val1);
}
|
|
Total comments: 0 | |