| | |
a c++ solution
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
c++ Syntax (Toggle Plain Text)
main() { int x,n, count=0; n=n+1 nxt: cout<<"x=.."; cin>>x; if(x>60) count=count+1; if(n==10) cout<<count; else goto nxt; }
What did you really write this program for ???
Last edited by csurfer; Jul 4th, 2009 at 12:12 pm.
I Surf in "C"....
To the OP:
How do you think variable n will ever get value 10 ?
You never explicitly put a value in it.
n will never become ten, so you can rip this out of your code, and it will work in exactly the same way.
>Its really hard even for us to know its LOGIC.
The LOGIC is: there's no LOGIC
How do you think variable n will ever get value 10 ?
You never explicitly put a value in it.
n will never become ten, so you can rip this out of your code, and it will work in exactly the same way.
C++ Syntax (Toggle Plain Text)
if(n==10) cout<<count;
>Its really hard even for us to know its LOGIC.
The LOGIC is: there's no LOGIC
Last edited by tux4life; Jul 4th, 2009 at 12:20 pm.
"Never argue with idiots, they just drag you down to their level and then beat you with experience."
![]() |
Similar Threads
- IE 6 running slow or jerky? solution (Web Browsers)
- A possible solution to about:blank problems (Viruses, Spyware and other Nasties)
- Smart client template solution ??? (ASP.NET)
- Solution for slow internet browsing (Web Browsers)
- IE won't let me access threads. Could someone email me a solution please? (Web Browsers)
- Pop up ads (Web Browsers)
- Conflict (Internet + Games) (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: Changing elements of lists
- Next Thread: VC++ CODE
| Thread Tools | Search this Thread |
Tag cloud for C++
api array arrays based beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library lines linker list loop looping loops map math matrix memory newbie news number output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort spoonfeeding string strings struct temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






