Remember the last C++ challenge question ? Here is the answer. It's C++ challenge not C :D.Wonder why ? Well all you have to do is to comment/delete the stdio.h inclusion.This makes the printf function an undeclared function, which you declare :D.The printing is done by using the cout function ;).
#include iostream.h
//#include stdio.h
void printf(char *c,int x)
{
cout<<"Nice trick, eh ? :)";
}
int main()
{
int a=100,b=30;
printf("%d",a+b);
return 0;
}
Doesn't sound that hard now,right ? :)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment