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
    Join Date
    May 2009
    Posts
    4,037
    Are you sure the program is supposed to be written in C++?

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,037
    Give expected output with given input.
    And, then, give output you got instead.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    4,037
    FYI to Admin: The OP attached a copyrighted document that likely violates the Copyright of the doc.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Program compilation result result still error
    By Zach Watterson in forum C Programming
    Replies: 3
    Last Post: 03-06-2021, 10:35 AM
  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