Is it correctly?(Calculate the factor of number) | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Is it correctly?(Calculate the factor of number)

#include<iostream> using namespace std; int main(){ int k; int f=1; int counter=1; cin>>k; A: f=f*counter; counter++; if(counter<=k) goto A; cout<<f; return 0; }

27th Mar 2019, 9:42 PM
Robi
1 Antwort
+ 2
Yes, it works fine.
28th Mar 2019, 12:23 AM
Denise Roßberg
Denise Roßberg - avatar