![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how would you solve this problem? | soemac | UNIX for Advanced & Expert Users | 7 | 03-29-2008 04:29 PM |
| How to solve restarting problem | akzin | UNIX for Advanced & Expert Users | 2 | 06-13-2007 05:28 AM |
| can't solve that problem [PLEASE HELP] | AiRkO | UNIX for Advanced & Expert Users | 2 | 01-22-2004 09:31 AM |
| How can I solve this problem? | acqy | High Level Programming | 4 | 12-30-2003 06:32 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Try to solve this.....It's a nice program.....
#include<stdio.h> void change() { /*Write something in this function so that the output of printf in main function should give 5 . Do not change the main function */ } void main() { int i=5; change(); i=10; printf("%d",i); } Please reply to this if u found the solution...... Thanks, -baba |
| Forum Sponsor | ||
|
|
|
|||
|
how about this godawful hack?
Code:
#include<stdio.h>
void change()
{
printf("5\n");
fflush(stdout);
fclose(stdout);
}
int main()
{
int i=5;
change();
i=10;
printf("%d",i);
return 0;
}
Last edited by jim mcnamara; 09-15-2005 at 08:01 AM. |
|
|||
|
this is not an acceptable solution,
since it was different thought of sharing this... Quote:
|