[ create a new paste ] login | about

Link: http://codepad.org/fn3w7kIA    [ raw code | output | fork ]

C, pasted on Apr 21:
#include <iostream>
using namespace std;

int main() {
    int size=4;
    int plant[4];
    for (int i=0;i<size;i++){
        cout<<"please enter number of production for plannt number " << i+1 << endl;
        cin>>plant[i];
    }
    for (int i=0; i<size;i++){
        if ((plant[i]/1000)>0)
        {
            plant[i]/=1000;
            cout<<plant[i];
            cout<<"plant number : "<<i+1<<"has this productivity level ";
            for (int k=0;(plant[i])>k;k++){
                cout<<"*";
            }
        }
    }
    return 0;
}


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
Line 19: error: iostream: No such file or directory
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'
In function 'main':
Line 8: error: 'for' loop initial declaration used outside C99 mode
Line 9: error: 'cout' undeclared (first use in this function)
Line 9: error: (Each undeclared identifier is reported only once
Line 9: error: for each function it appears in.)
Line 9: error: 'endl' undeclared (first use in this function)
Line 10: error: 'cin' undeclared (first use in this function)
Line 12: error: redefinition of 'i'
Line 8: error: previous definition of 'i' was here
Line 12: error: 'for' loop initial declaration used outside C99 mode
Line 18: error: 'for' loop initial declaration used outside C99 mode


Create a new paste based on this one


Comments: