C2- Lecture Problem 1
CodeChefOpen on judge ↗
Given an integer $N$ as input: - if $N$ is even : evaluate and print the factorial value of $N$ - if $N$ is odd : evaluate and print the sum of all the whole numbers up to and including $N$ ###Input: Only line of the input contains a single integer $N$ ###Output: Output a single integer denoting the value after the evaluation given above. ###Constraints - $2 \leq N \leq 19$
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start