hi all... thanx my dear Saswatpadhi for helping me... thnx alot.. i have headache due to my this problem.. hope u can help me.. i have to print tables from 2 to 20 in order that once a table is viewed.. then a message displays that Press any key to continue.. then if i press any key then the next table displays.. till now i can only print 2 to 20 tables but i didnt control over this message that Press any key to continue.. it makes some errors.. so please kindly help me... ----- Raza Elahi
There are two ways to display the message : (1) Through the console : Code: system("pause"); // use #include <stdlib.h> (1) Through C or C++ : Code: printf("Press any key to continue ...\n"); getchar(); So, the final code will be : Code: #include <stdio.h> #include <stdlib.h> int main() { int Cnt, X; for(Cnt = 2; Cnt < 21; ++Cnt) { for(X = 1; X< 11; ++X) // The table printf("%d * %d = %d\n", Cnt, X , Cnt*X); putchar(10); // print a newline system("pause"); putchar(10); // print a newline } return 0; }
I know this isn't what anyone wants to hear but if you keep giving riz09 completed code he'll keep being dependent instead of learning for himself how to program. This is a REALLY EASY task he should have been able to figure out for himself. riz09: by all means ask for help, but completed examples don't help you. When you get to the exam where you can't ask on go4expert, you'll be completely stuck and will fail the exam. Have a go instead of posting here, and ask for help with what you're stuck on. The problem of course is that your assignments will get increasingly difficult so you need to break this dependency cycle as soon as possible.
Never thought about it this way, but :iagree:. Next time, show us your progress first and then we will help. We won't do your homework here.
u all r right but my dear friends.. i m a hard worker.. u knw daily i do miscellaneous projects nd sometimes i got success but sometimes i lose.. thats y i try again nd again.. but i m only here to sort out whats missing in my program.. what problem i m facing.. i m only here to ask u all.. bcoz this is the portal where v can share our problems regarding programming.... Actually in our college there's not a teacher of ICP (introduction to computer programming) thats y i m facing these problems as exams is near.. To Mr. Admin.. am i having a right to post here my problems or faces this type of posts..?