2 ms·
This is not true at all. This: #include<stdio.h> main() { int sum; int x; sum=0; for(x=1;x<=50;++x) { sum = sum + x;
by StreamBright 8y ago
This is not true at all.
This:
#include<stdio.h>
main()
{
int sum; int x; sum=0;
for(x=1;x<=50;++x)
{
sum = sum + x;
}
printf(" 1+2+...+50=%d\n",sum);
}
Is more cognitive load and error prone than this:
(println (reduce + (range 1 50)))
This is mostly what experienced FP advocates tell you. Btw. you can transpile the latter to the former.