Thread: C Program compilation result result still error

  1. #1
    Registered User
    Join Date
    Mar 2021
    Posts
    2

    Post C Program compilation result result still error

    Please help me correct my code, I don't know if there's something wrong with it but I've got a successful compilation.

    I've tried to make this code, the code is successfully compiled but I'm sill getting a wrong (compiler error issue) when submission. Here's my full code, I'm completely lost and I don't know if my code contains an error :


    Code:
    #include <iostream>
    
    using namespace std;
    
    
    int main (int argc, char** argv){
        int N = 100;
        int M = 10;
        
        cin >> N >> M;
        for(int i = 0; i < M; i++){
        cout << N << endl;
        N++;
            
        }
        
        return 0;
    }
    I appreciate for anyone who helps me cause I'm still learning.

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    804
    You are in the wrong forum as your code is C++ NOT C.

    C++ Forum

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,618
    > the code is successfully compiled but I'm sill getting a wrong (compiler error issue) when submission
    Well I guess the important thing to check is whether you're supposed to be submitting C code or C++ code.

    If you're using a Windows based IDE for example, the default project is often a C++ project, and that will compile your code just fine.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    38,618
    Duplicated here, and school copyrighted material deleted.
    C ++ Program compilation result result still error
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Logical error: I'm not getting expected result
    By rm82co in forum C++ Programming
    Replies: 6
    Last Post: 07-03-2019, 02:21 PM
  2. I test for a result, but any result over 1 fails
    By jeremy duncan in forum C++ Programming
    Replies: 10
    Last Post: 05-23-2012, 01:23 PM
  3. No error, but the result is unexpected
    By Nimbuz in forum C Programming
    Replies: 10
    Last Post: 07-24-2009, 03:10 PM
  4. error msg instead of the result so far
    By maybabier in forum C Programming
    Replies: 25
    Last Post: 03-20-2009, 02:45 PM
  5. Return value: Error or result?
    By Cactus_Hugger in forum C Programming
    Replies: 3
    Last Post: 05-03-2007, 12:23 AM

Tags for this Thread