[ create a new paste ] login | about

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

C++, pasted on Jan 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# include<stdio.h>

using namespace std;
int main()
{
for(int i = 1; i<21; i++){
    if (i%3 == 0 && i%5 == 0){
    cout<<"FizzBuzz"<<endl;
}
    elseif (i%3 == 0){
    cout<<"Fizz"<<endl;
}
    elseif (i%5 == 0){
    cout <<"Buzz"<<endl;
}
    else
    cout <<i<<endl;
}
}


Output:
1
2
3
In function 'int main()':
Line 10: error: 'elseif' was not declared in this scope
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: