| | |
Array help
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Feb 2006
Posts: 23
Reputation:
Solved Threads: 1
after a whole week. I found out the problem and I can't believe it was simple.
C++ Syntax (Toggle Plain Text)
#include <iostream> // needed for cin/count #include <cmath> // needed for math functions using namespace std; /**************************** * prototypes //declared function so main can find *****************************/ int isLeapYear(int year); /************************************** * ***************************************/ int main() { int x; int y; int z; cout << " Enter the month, day, and year\n "; cin >> x >> y >> z; if (isLeapYear(z)) cout << "Leap Year\n"; else cout << "Not Leap Year\n"; cin.get(); system("pause"); } int isLeapYear(int year) { bool statement; if ( (year%400) == 0 ) statement = true; else if ( (year%100) == 0 ) statement = false; else if ( (year%4) == 0 ) statement = true; else statement = true; return statement; }
![]() |
Similar Threads
- Can I ghost a RAID array??? (Windows NT / 2000 / XP)
- Creating dynamic array structures (C++)
- Array limit (C)
- struct dynamic 2d array alloc (C)
- string to integer array transformation (C)
- Array (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: Does anyone have the stomach to look over my program?
- Next Thread: C++ HTTP post/get submitting and communication
Views: 1537 | Replies: 10
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bitmap c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll encryption error file forms fstream function functions game getline givemetehcodez google graph homeworkhelper iamthwee ifstream input int integer java lazy lib linkedlist linux loop looping loops map math matrix memory microsoft newbie news node number output parameter pointer problem program programming project proxy python random read recursion recursive reference return sort string strings struct studio system template templates test text tree unix url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





