guy i need a help i need a code for 12 hour clock for c progrem for atm8535 can any one help me plz

include<iostream>

include<string>

using namespace std;

int main()

#include<iostream>
#include<string>
using namespace std;

int main()

{

          int hours, minutes;
          string; ampm // stores AM or PM depending on the value of 'hours'


          cout << "Enter the hour followed by a space followed by the minutes." << endl;
          cin >> hours >> minutes;



          if(hours > 12) // If it is bigger than 12 then you take out 12 from it.
          {


                    hours -= 12;
                    ampm = "PM";
          }
          else // If not, then do not do anything to it and just make 'ampm' "AM"
          {

                    ampm = " AM";
          }


          cout << hours << ':' << minutes << ampm << endl; // Output the values



          return 0;

}




      int hours, minutes;
      string; ampm // stores AM or PM depending on the value of 'hours'


      cout << "Enter the hour followed by a space followed by the minutes." << endl;
      cin >> hours >> minutes;



      if(hours > 12) // If it is bigger than 12 then you take out 12 from it.
      {


                hours -= 12;
                ampm = "PM";
      }
      else // If not, then do not do anything to it and just make 'ampm' "AM"
      {

                ampm = " AM";
      }


      cout << hours << ':' << minutes << ampm << endl; // Output the values



      return 0;



#include<iostream>
#include<string>
using namespace std;

int main()

{

          int hours, minutes;
          string; ampm // stores AM or PM depending on the value of 'hours'


          cout << "Enter the hour followed by a space followed by the minutes." << endl;
          cin >> hours >> minutes;



          if(hours > 12) // If it is bigger than 12 then you take out 12 from it.
          {


                    hours -= 12;
                    ampm = "PM";
          }
          else // If not, then do not do anything to it and just make 'ampm' "AM"
          {

                    ampm = " AM";
          }


          cout << hours << ':' << minutes << ampm << endl; // Output the values



          return 0;

}

this is my code i done and i am cnfuse with it can any one help me plz

Just to make sure, you're using this code on this microcontroller, right?
http://www.atmel.com/devices/atmega8535.aspx

Somehow, I doubt that's going to work.
What kind of screen are you using?
Line LCD like this: http://www.digikey.com/product-detail/en/VI-322-DP-RC-S/153-1005-ND/10188
(which would make sense for an LCD clock)

OR

Text LCD like this:
http://www.digikey.com/product-detail/en/NHD-0216PZ-FL-YBW-PC/NHD-0216PZ-FL-YBW-PC-ND/2165970
(which would make sense for the code you're using)

This article has been dead for over six months. Start a new discussion instead.