BugHunt 4: If

Difficulty: Very Easy
Time to solve: 1-2 min
Video this is covered in: 1-5

#include 
#include 
using namespace std;
int main(){
    
    cout << "Enter the number 5 to see a secret message: ";
    int x=0;
    cin >> x;
    
    if (x=5){
        cout << "I love you!\n";
    }
    else{
        cout << "That wasn't the number 5!\n";
    }
return 0;
}

Input: 7
Program output: “I love you!”

BugHunt #5 – Loops

Difficulty: Very Easy
Time to solve: 1-2 min
Video this is covered in: 1-10


#include 

using namespace std;
int main(){

    int i = 0;
    while (i<10){
        cout << i <

Input: 7
Error MessageTesting.cpp:9: error: expected primary-expression before ‘;’ token

BugHunt #6 — More loops

Difficulty: Very Easy
Time to solve: 1-2 min
Video this is covered in: 1-15



#include 

using namespace std;
int main(){

    for (int i=0; i<100; i++){
        cout << i;
        if ((i % 25)=0){
            break;
        }
    }
    
return 0;
}

Error MessageTesting.cpp:8: error: non-lvalue in assignment

Difficulty: Very Easy
Time to solve: 1-2 min
Video this is covered in: 1-20



#include 

using namespace std;
int main(){
    int i=0;
    for (i=0; i<100; i++){
        cout << i;
        if ((i % 25)==0){
            break;
        }
    }
    cout <
              

Difficulty: Easy
Time to solve: 1-2 min
Video this is covered in: 1-25


#include 

using namespace std;

void addition(int, int);

int main(){

    cout << "Enter number 1: ";
    int x=0;
    cin >> x;
    
    cout << "Enter number 2: ";
    int y=0;
    cin >> y;
    
    cout << addition(x,y);
    
    
return 0;
}

void addition(int x, int y){
    return x+y;
}

Error MessageYATesting.cpp: In function `int main()’:
YATesting.cpp:17: error: no match for ‘operator<<' in 'std::cout << addition(x, y)' /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:63: note: candidates are: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>&(*)(std::basic_ostream<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:74: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ios<_CharT, _Traits>&(*)(std::basic_ios<_CharT, _Traits>&)) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:86: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base&(*)(std::ios_base&)) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:121: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:155: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:98: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:178: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:189: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:193: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:204: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:179: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:214: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:238: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:219: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:261: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:284: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:307: note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_streambuf<_CharT, _Traits>*) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:449: note: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:505: note: std::basic_ostream& std::operator<<(std::basic_ostream&, char) [with _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:460: note: std::basic_ostream& std::operator<<(std::basic_ostream&, signed char) [with _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:465: note: std::basic_ostream& std::operator<<(std::basic_ostream&, unsigned char) [with _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:567: note: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*) [with _CharT = char, _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/ostream.tcc:612: note: std::basic_ostream& std::operator<<(std::basic_ostream&, const char*) [with _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:499: note: std::basic_ostream& std::operator<<(std::basic_ostream&, const signed char*) [with _Traits = std::char_traits]
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/ostream:504: note: std::basic_ostream& std::operator<<(std::basic_ostream&, const unsigned char*) [with _Traits = std::char_traits]
YATesting.cpp: In function `void addition(int, int)’: