-
C++ to C
I have a code written in C++ and I need to convert it to C. I don't have as much experience in C, can anyone give me a hand in the conversion?
Code:
#include <iostream>
using namespace std;
int main()
{int m,d,y;
cout<<"Enter month: ";
cin>>m;
cout<<"Enter day: ";
cin>>d;
cout<<"Enter year: ";
cin>>y;
cout<<"The day after "<<m<<"/"<<d<<"/"<<y<<" is: ";
d++;
if(d>30)
{d=1;
m++;
if(m>12)
{m=1;
y++;
}
}
cout<<m<<"/"<<d<<"/"<<y<<endl;
system("pause");
return 0;
}
-
I suggest that you learn about C I/O available via <stdio.h>.
-
> I have a code written in C++
I can haz a serch enjun
You found your homework on another forum, and now you want help turning it into the right programming language.