Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

FCTRL2 WRONG ANSWER

$
0
0

**


Here is my block of code kindly tell me what i am doing wrong


**

#include <iostream>

using namespace std;

/*
 *
 */
int main(int argc, char** argv) {
    int testcase, n, i = 1;
    long fctrl = 1;
    scanf("%d", &testcase);
    while(testcase--) {
        cin >> n;
        while(i <= n) {
            fctrl *= i;
            i++;
        }
        printf("%d\n", fctrl);
    }

    return 0;
}

Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>