Click here to Skip to main content
15,885,914 members
Home / Discussions / C#
   

C#

 
AnswerRe: Can share different invocations of an application the same static data Pin
Richard Andrew x642-Apr-16 9:40
professionalRichard Andrew x642-Apr-16 9:40 
AnswerRe: Can share different invocations of an application the same static data Pin
Brisingr Aerowing2-Apr-16 14:27
professionalBrisingr Aerowing2-Apr-16 14:27 
GeneralRe: Can share different invocations of an application the same static data Pin
Wolfgang Kurz2-Apr-16 21:13
professionalWolfgang Kurz2-Apr-16 21:13 
AnswerRe: Can share different invocations of an application the same static data Pin
Bernhard Hiller4-Apr-16 0:37
Bernhard Hiller4-Apr-16 0:37 
Questionhelp me in this code Pin
Kulbeer sidhu2-Apr-16 2:18
Kulbeer sidhu2-Apr-16 2:18 
AnswerRe: help me in this code Pin
OriginalGriff2-Apr-16 2:31
mveOriginalGriff2-Apr-16 2:31 
GeneralRe: help me in this code Pin
Ratul Thakur2-Apr-16 4:15
Ratul Thakur2-Apr-16 4:15 
AnswerRe: help me in this code Pin
Ratul Thakur2-Apr-16 3:52
Ratul Thakur2-Apr-16 3:52 
using System;

namespace blahblah
{
class blah
{
static int a=0;
public static void Main()
{
HOME:
Console.WriteLine("Enter any number:");
a = Convert.ToInt32(Console.ReadLine());
if(a <= 0)
{
Console.WriteLine("The number must be greater than zero");
a = 0;
Main();
}
}
}
}


^^ this works fine
But you gota remove all the parameters in the main function.
this gives the following output:

Enter any number:
0
The number must be greater than zero
Enter any number:
..... so on
GeneralRe: help me in this code Pin
Sascha Lefèvre2-Apr-16 4:50
professionalSascha Lefèvre2-Apr-16 4:50 
GeneralRe: help me in this code Pin
Ratul Thakur2-Apr-16 6:33
Ratul Thakur2-Apr-16 6:33 
GeneralRe: help me in this code Pin
F-ES Sitecore3-Apr-16 4:15
professionalF-ES Sitecore3-Apr-16 4:15 
GeneralRe: help me in this code Pin
Pete O'Hanlon3-Apr-16 4:51
mvePete O'Hanlon3-Apr-16 4:51 
GeneralRe: help me in this code Pin
F-ES Sitecore3-Apr-16 4:56
professionalF-ES Sitecore3-Apr-16 4:56 
GeneralRe: help me in this code Pin
Ratul Thakur3-Apr-16 7:46
Ratul Thakur3-Apr-16 7:46 
GeneralRe: help me in this code Pin
Sascha Lefèvre3-Apr-16 13:11
professionalSascha Lefèvre3-Apr-16 13:11 
GeneralRe: help me in this code Pin
F-ES Sitecore3-Apr-16 22:38
professionalF-ES Sitecore3-Apr-16 22:38 
JokeRe: help me in this code Pin
Pete O'Hanlon3-Apr-16 22:57
mvePete O'Hanlon3-Apr-16 22:57 
AnswerRe: help me in this code Pin
Sascha Lefèvre2-Apr-16 5:10
professionalSascha Lefèvre2-Apr-16 5:10 
GeneralRe: help me in this code Pin
OriginalGriff2-Apr-16 6:16
mveOriginalGriff2-Apr-16 6:16 
GeneralRe: help me in this code Pin
Mycroft Holmes2-Apr-16 13:32
professionalMycroft Holmes2-Apr-16 13:32 
GeneralRe: help me in this code Pin
Sascha Lefèvre2-Apr-16 14:15
professionalSascha Lefèvre2-Apr-16 14:15 
GeneralRe: help me in this code Pin
Mycroft Holmes2-Apr-16 16:32
professionalMycroft Holmes2-Apr-16 16:32 
AnswerRe: help me in this code Pin
Suresh73-Apr-16 5:55
Suresh73-Apr-16 5:55 
QuestionInput string was not in a correct format as output in c# console application Pin
KittoKy2-Apr-16 1:48
KittoKy2-Apr-16 1:48 
AnswerRe: Input string was not in a correct format as output in c# console application Pin
OriginalGriff2-Apr-16 2:25
mveOriginalGriff2-Apr-16 2:25 

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.