Click here to Skip to main content
15,895,656 members
Home / Discussions / C#
   

C#

 
Questionoracle Client Pin
shereem khaleel7-Jun-07 9:34
shereem khaleel7-Jun-07 9:34 
AnswerRe: oracle Client Pin
Rick van Woudenberg7-Jun-07 11:42
Rick van Woudenberg7-Jun-07 11:42 
QuestionNeed to pass structure to assembly Pin
Amit Kumar G7-Jun-07 9:08
Amit Kumar G7-Jun-07 9:08 
AnswerRe: Need to pass structure to assembly Pin
Not Active7-Jun-07 9:16
mentorNot Active7-Jun-07 9:16 
GeneralRe: Need to pass structure to assembly Pin
Amit Kumar G7-Jun-07 9:24
Amit Kumar G7-Jun-07 9:24 
GeneralRe: Need to pass structure to assembly Pin
Not Active7-Jun-07 9:42
mentorNot Active7-Jun-07 9:42 
GeneralRe: Need to pass structure to assembly Pin
Amit Kumar G7-Jun-07 10:04
Amit Kumar G7-Jun-07 10:04 
QuestionHelp with simple guess number - program (while loop) Pin
Husker477-Jun-07 8:27
Husker477-Jun-07 8:27 
I'm a beginner in C# and I tried to make a console program where you enter a number, then the program tells you if your guess was too low or high, and you keep guessing until your guess is correct. I really thought that my code would work, but it doesn't. Can anybody please guide me in the right direction?

<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
<br />
namespace ConsoleApplication1<br />
{<br />
    class Program<br />
    {<br />
        static void Main(string[] args)<br />
        {<br />
            //Variables<br />
            Random a = new Random();<br />
            int counter = 0;<br />
            int guess;<br />
            int rand = 0;<br />
            rand = (int) a.Next(0,10);<br />
<br />
            //Start of the program<br />
            Console.Write("Enter your guess: ");<br />
            guess = Console.Read();<br />
<br />
            //While loop to test the number<br />
            while(guess != rand)<br />
            {<br />
                if(guess > rand)<br />
                {<br />
                    Console.WriteLine("Wrong number, you aimed too high");<br />
                }<br />
<br />
                if(guess < rand)<br />
                {<br />
                    Console.WriteLine("You aimed too low");<br />
                }<br />
<br />
                Console.Write("Please guess again: ");<br />
                guess = Console.Read();<br />
                counter++;<br />
            }<br />
<br />
            //In case your guess was correct<br />
            Console.WriteLine("Congratulations, you rock!");<br />
            Console.WriteLine("It took you {0} tries", counter);<br />
        }<br />
    }<br />
}

AnswerRe: Help with simple guess number - program (while loop) Pin
Luc Pattyn7-Jun-07 8:32
sitebuilderLuc Pattyn7-Jun-07 8:32 
AnswerRe: Help with simple guess number - program (while loop) Pin
Jimmanuel7-Jun-07 8:54
Jimmanuel7-Jun-07 8:54 
GeneralRe: Help with simple guess number - program (while loop) Pin
Husker477-Jun-07 9:02
Husker477-Jun-07 9:02 
GeneralRe: Help with simple guess number - program (while loop) Pin
Jimmanuel7-Jun-07 9:03
Jimmanuel7-Jun-07 9:03 
Questiondatagridview selected row, highlight row Pin
FernandoMartin7-Jun-07 8:05
FernandoMartin7-Jun-07 8:05 
AnswerRe: datagridview selected row, highlight row Pin
Salogus7-Jun-07 12:46
Salogus7-Jun-07 12:46 
QuestionDynamic Assembly Loading Pin
ATCsharp7-Jun-07 7:32
ATCsharp7-Jun-07 7:32 
AnswerRe: Dynamic Assembly Loading Pin
Le centriste7-Jun-07 7:53
Le centriste7-Jun-07 7:53 
GeneralRe: Dynamic Assembly Loading Pin
ATCsharp7-Jun-07 8:17
ATCsharp7-Jun-07 8:17 
AnswerRe: Dynamic Assembly Loading Pin
Luc Pattyn7-Jun-07 8:35
sitebuilderLuc Pattyn7-Jun-07 8:35 
GeneralRe: Dynamic Assembly Loading Pin
ATCsharp7-Jun-07 8:59
ATCsharp7-Jun-07 8:59 
AnswerRe: Dynamic Assembly Loading Pin
Not Active7-Jun-07 9:13
mentorNot Active7-Jun-07 9:13 
GeneralRe: Dynamic Assembly Loading Pin
ATCsharp7-Jun-07 9:35
ATCsharp7-Jun-07 9:35 
Questionplay mp3 from stream Pin
Dirk Reske7-Jun-07 6:36
Dirk Reske7-Jun-07 6:36 
AnswerRe: play mp3 from stream Pin
Sathesh Sakthivel7-Jun-07 6:53
Sathesh Sakthivel7-Jun-07 6:53 
GeneralRe: play mp3 from stream Pin
Dirk Reske7-Jun-07 6:59
Dirk Reske7-Jun-07 6:59 
QuestionMultithreading and Reflection question? Pin
Rojan Gh.7-Jun-07 6:21
professionalRojan Gh.7-Jun-07 6:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.