Sponsored Links


Results 1 to 2 of 2

Thread: when user enter 6 number guessing game of tossing coin

  1. #1
    sana.pari
    Guest

    Icon14 when user enter 6 number guessing game of tossing coin

    Sponsored Links1


    hello sir am kavita sir u have give prog for practice in lec 11 u have said that try to use random function n for tossing n die guessing game sir i have form these 2 program plz check it either it right or not and also sir u have said that check is it fair die or not sir it is not fair die according to me it not generate every time random number.according to functionality of random function the number should be change every time when i run my die program it always give write answer when user enter 6 number guessing game of tossing coin #include #include main() { int num,guessNum; cout<<"lets play guessing game of tossing a coin "<<<"select 0 for head"<<<"select 1 for tail"<>num; guessNum=rand()%2; if(guessNum==num) { cout<<"your guess is right it is :"; if(guessNum==1) cout<<"tail"; else cout<<"head"; } else cout<<"your guess is in correct"; } prog#2 guessing game of die #include #include main() { int num,guessNum; cout<<"lets play a guessing game of rolling die:"<<<"please chose any number from 1 to 6:"<>num; guessNum=1+rand()%6; if(guessNum==num) { cout<<"your guess is right it is :"<<<"your guess is in correct"; }

    Sponsored Links

  2. #2
    dear student, yes your view poin is correct to an extent that random function generates random numbers every time executes. As for as your code is concerned it is not complete although logic is correct. Try to compile it in the compiler and if you face any issues then let it know.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 01-02-2015, 12:10 AM
  2. program does not enter for loop in Java 2011
    By Vuhelper in forum Java forum
    Replies: 0
    Last Post: 07-23-2011, 05:44 PM
  3. Replies: 0
    Last Post: 07-20-2011, 07:33 PM
  4. C++ Guessing Game include Number and ABC
    By Vuhelper in forum C++ Programing
    Replies: 0
    Last Post: 06-15-2011, 06:19 PM
  5. Replies: 1
    Last Post: 04-24-2011, 06:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft