How to add a code TestIfElse(10) to the Main method of the Program.cs class?

How to add a code  TestIfElse(10) to the Main method of the Program.cs class?
Here is my code and I have copied from the Wiley book for Microsoft certification page 14,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ifelse_Statement
    class Program
        static void Main(string[] args);
        TestIfElse(10);
        public static void TestIfElse(int n);
        if(n < 10)
                 Console.WriteLine("n is less than 10");
         else if(n < 20)
                Console.WriteLine("n is less than 20");
         else if(n < 30)
            Console. WriteLine("n is greater than or equal to 30");
Here is the error list I am getting,
Error 1      Method must have a return type        C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
12 13
switch_Statement
Error 2
Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
12 24
switch_Statement
Error 3
Method must have a return type C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
12 9
ifelse_Statement
Error 4
Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
12 20
ifelse_Statement
Error 5
Invalid token 'if' in class, struct, or interface member declaration
C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
16 9
ifelse_Statement
Error 6
Invalid token '10' in class, struct, or interface member declaration
C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
16 16
ifelse_Statement
Error 7
Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
16 16
ifelse_Statement
Error 8
Invalid token '(' in class, struct, or interface member declaration
C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
18 35
ifelse_Statement
Error 9
A namespace cannot directly contain members such as fields or methods
C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
20 10
ifelse_Statement
Error 10
Type or namespace definition, or end-of-file expected
C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
30 1
ifelse_Statement
Error 11
The type or namespace name 'n' could not be found (are you missing a using directive or an assembly reference?)
c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
16 12
ifelse_Statement
Error 12
'System.Console.WriteLine(string, params object[])' is a 'method' but is used like a 'type'
c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
18 26
ifelse_Statement

static void Main(string[] args){
TestIfElse(10);
public static void TestIfElse(int n)
if (n < 10)
Console.WriteLine("n is less than 10");
else if (n < 20)
Console.WriteLine("n is less than 20");
else if (n < 30)
Console.WriteLine("n is greater than or equal to 30");
Fouad Roumieh

Similar Messages

  • How to Add F4 Help To a Screen Field In a Module Pool Program

    Hi Friends,
    1. How to Add F4 Help To a Screen Field In a Module Pool Program?
    2. How to select a single cell in ALV report output for interactive reporting ?
    Kindly give code example.
    regards,
    Pradeep

    Hi,
    Try using the fm 'F4IF_INT_TABLE_VALUE_REQUEST'.
    Refer the link below for selecting  single cell.
    alv
    Reward points if useful.
    Regards
    Rose

  • Help:  How to add a library item to hide the default Window menu

    Hi,
    In this post: Help: How to add a library item to hide the default Window menu, it described how to create an menu that will hide the default window menu.
    I'd like to know if there a way to put this component into library so that others can directly inherit this menu in other FORMS and how to implement it.
    Jimmy

    Hi,
    I found the solution and the post was not properly phrased. There is no need to add menu into library. All we need is to put the compiled menu into Oracle AS and add the menu name the menu module of the given form.
    Thanks.
    Jimmy

  • How to add a SPACE as suffix to the last field in the downloaded text file?

    Hi Experts,
    By using GUI_DOWNLOAD am saving the data(only 3 fields) in a text file on my desk top.
    fine.
    example current record1 : 010001                      354.999            26.000
    here, after 3rd field 26.000, immediately the cursor is jumping to next line in text file.
    but, wanna a SINGLE SPACE after 26.000, say 26.000+space.
    tried with CONCATENATE, OFFSETTING, but no use(may b am using incorrectly)
    so, pls. suggect me, How to add a SPACE as suffix to the last field in the downloaded text file?
    thanq

    Sorry...Typo error...Too many in the last few days -:(
    Wanted to say AFTER -:)
    Do it like this...
    FIELD1 TYPE XXX,
    FIELD2 TYPE XXX,
    FIELD3 TYPE XXX,
    SPACE(1) TYPE C,
    That way you should end with...
    26.000+SPACE
    Greetings,
    Blag.

  • How to update Tr code FB02   and update the field reference key1 (bseg-xref

    Can any body
    help me how to update   Tr code   fb02
    and  update the field  reference  key1 (bseg-xref1)  with the interest amount
    calculated.
    Below i have  written My  program  flow logic
    The program should read the open items i.e debit items in the customer account,
    Based on the  invoice date and customer payment terms  calculate the due date and then the  interest should be  calculated on that item based on the due date.
    Use the  transaction  fb02  and update the field  reference  key 1 (BSEG-xref1)
    with the interest amount calculated
    Only  consider  customers whose  interest indicator  knb1-vzskz = 'vk'.
    Interest is to be  calculated for every  30  days
    at the rate of  1% .please see example below.
    Document date is 01.01.2007
    for amount  1000SGD   payment  term  7  days
    It becomes  due  on  08.01.2007
    until  06.02.2007 you should not  consider  for calculation of interest
    SGD  on   7.02.2007 run you can consider this  item for interest calculation

    Hi Robert,
    Thanks for answering.
    I am looking at Ref 2 should flow automatically to clearing document from the accounitng document for billing.
    Ex: Billing document is created and accounted. Ref 2 is AB
    Now when receipt is accounted for this biling document this AB should flow automatically to Ref 2 field.
    Thanks
    NNS.

  • How to add a location of face in the new Photo App?

    How to add a location of face in the new Photo App?

    You have to open a photo, right klick it and click "add a new face" or something like that.

  • How to add byte[] array based Image to the SQL Server without using parameter

    how to add byte[] array based Image to the SQL Server without using parameter.I have a column in table with the type image in sql and i want to add image array to the sql image column like below:
    I want to add image (RESIM) to the procedur like shown above but sql accepts byte[] RESIMI like System.Drowing. I whant that  sql accepts byte [] array like sql  image type
    not using cmd.ParametersAdd() method
    here is Isle() method content

    SQL Server binary constants use a hexadecimal format:
    https://msdn.microsoft.com/en-us/library/ms179899.aspx
    You'll have to build that string from a byte array yourself:
    byte[] bytes = ...
    StringBuilder builder = new StringBuilder("0x", 2 + bytes.Length * 2);
    foreach (var b in bytes)
    builder.Append(b.ToString("X2"));
    string binhex = builder.ToString();
    That said, what you're trying to do - not using parameters - is the wrong thing to do. Not only it is insecure due to the risk of SQL injection but in the case of binary data is also inefficient since these hex strings are larger than the original byte[]
    data.

  • How to add a Quick Search Region of the shuttle

    JHeadstart 10.1.3.1.26
    Help me! Help me! Help me!
    How does add a Quick Search Region of the shuttle
    http://cid-857a1e2135747b0c.spaces.live.com/?_c11_PhotoAlbum_spaHandler=TWljcm9zb2Z0LlNwYWNlcy5XZWIuUGFydHMuUGhvdG9BbGJ1bS5GdWxsTW9kZUNvbnRyb2xsZXI%24&_c11_PhotoAlbum_spaFolderID=cns!857A1E2135747B0C!112&_c11_PhotoAlbum_startingImageIndex=&_c11_PhotoAlbum_commentsExpand=&_c11_PhotoAlbum_addCommentExpand=&_c11_PhotoAlbum_addCommentFocus=&_c=PhotoAlbum
    Message was edited by:
    user589457

    JHeadstart 10.1.3.1.26
    Help me! Help me! Help me!
    How does add a Quick Search Region of the shuttle
    http://cid-857a1e2135747b0c.spaces.live.com/?_c11_PhotoAlbum_spaHandler=TWljcm9zb2Z0LlNwYWNlcy5XZWIuUGFydHMuUGhvdG9BbGJ1bS5GdWxsTW9kZUNvbnRyb2xsZXI%24&_c11_PhotoAlbum_spaFolderID=cns!857A1E2135747B0C!112&_c11_PhotoAlbum_startingImageIndex=&_c11_PhotoAlbum_commentsExpand=&_c11_PhotoAlbum_addCommentExpand=&_c11_PhotoAlbum_addCommentFocus=&_c=PhotoAlbum
    Message was edited by:
    user589457

  • HT4356 My printer, Epson Stylus Office TX600FW, is not listed on the AirPrint. How to add it? Would Apple expand the list?

    My printer, Epson Stylus Office TX600FW, is not listed on the AirPrint. I can't find it on my iPad or iPhone. How to add it? Would Apple expand the list?

    Only the printer manufacturer can make it compatible with AirPrint, it's not up to Apple. You could try Epson's iPrint app, that claims to support that model :
    http://itunes.apple.com/us/app/epson-iprint/id326876192?mt=8

  • How to add DRAM FIFO-128bi​t to the FPGA project?

    How do I add the DRAM FIFO - 128 Bit Memory Interface to a PXIe-796XR RIO module?
    Above project is from one of the example projects. I know how to add DRAM but not how to configure it as FIFO 128bit as above.
    Any guidance is appreciated.
    Solved!
    Go to Solution.

    I really have not found a way to add the DRAM 128bit fifo to the design. Adding normal DRAM and target specific FIFO's and host-target FIFO's is easy, but the special DRAM implemented as a giant FIFO I could not find how to add. And I have searched the documentation - but obviously missed the key point. I use labVIEW 2013. Any hints are appreciated.

  • How to Add a correspondence type and tick the parameter(FI Down Payment)

    Hi All,
    To use the Down-Payments functionality of SAP for customer payments. Part of the process will be to print off a request for the customer to pay based on data that is entered into transaction F-37 (Down-Payment Request).
    I have created a new sapscripts for the Down-Payment Request. We will need a new correspondence type creating for this print. For ZFI006 to show anything the u201CNoted Itemsu201D must be ticked when printed in ZFI006 using correspondence ZAP11.
    Kindly advice me how to add a new correspondence type and the u201CNoted Itemsu201D must be ticked?
    Thanks.

    Hi,
    You cannot define a payment type as that is based on a lookup defined under the navigation Setup>lookup>Payables.
    This look up access level is System whihc implies it does not allow user level values to be defined.
    So you have to use the available payment types,
    Thanks
    Manish Jain.

  • How do i resolve this....the program cant start because MSVC.dll is missing from your computer.ive uninstaled and reinstaled i tunes, still getting this message

    how do i resolve this....the program cant start because MSVC.dll is missing from your computer.ive uninstaled and reinstaled i tunes, still getting this message

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components; this won't normally affect its library, but that should be backed up anyway.
    (99150)

  • How to check whether a file exist in the program folder or not?

    Hi guys,
    how to check whether a file exist in the program folder or not? Let is say i recieve a file name from user then i want to know if the file is there not and act on that base.
    abdul

    Look at the class java.io.File and the .exists() method:
    http://java.sun.com/j2se/1.4/docs/api/java/io/File.html

  • How to add Custom code in Report Painter

    Hi All,
      I have a requirement to add Authorization checks at Profit Center Level for 8A-PCA001G report. This is the first time am working on Report Painter/Writer. I am wondering whether i can add custom code or not. Please suggest me how to do this. I copied 8A-PCA001G into a zreport but did not find anywhere to add custom code.
    Any help would be really appreciated.
    Thanks,
    Kumar

    Hi Kumar,
    You cannot write custom code (0% coding) in an Report Writer/Painter report. The code is generated by SAP while generating the Report group. The only place in a report writer report where you can write very minimal code is at varables level or formulas inside reports.
    At the report group header level, there is provision to provide authorization group. Try that.
    Regards,
    Subin John.
    Edited by: subin john on Mar 24, 2011 10:36 AM

  • How to reset "Add Printer" code on 6500a? The original one generated expired and site won't accept.

    What are the exact steps to reset the "Add Printer" code\email for the OfficeJet 6500a? 
    I set up the wireless portion and was generated a code, however trying to register and enter it into the website, it will not accept stating that is has expired (being after the 24 hour time frame).
    Thus, I attempted to find the options to "generate" a new one, and it doesn''t seem to exist.  I reset all wireless settings to default, and attempted to find the code -- and it remains the same.
    What are the exact step by step clicks I need to press on the printer to get a new code that will be accepted by the ePrint website?
    Thank you in advance for your insight.

    Hi mcseqt,
    You can just reprint the instruction page and you will be able to add the printer code again within 24 hours.
    To do so, go to Setup >> Web Services Setup >> ePrint Email Address
    This will print out the eprint instruction page again.
    Thank you.
    I am an HP employee
    **** Please mark the post that solves your problem as "Accepted Solution" ****

Maybe you are looking for

  • FCP7.0.3 crashing with Motion template on Snow Leopard

    Have upgraded from a Leopard from the 2009 MacPro install of Final Cut Studio3 to Snow Leopard on the current Westmere hardware with the same Final Cut Studio 3 application. The Motion Templates in the FCP application are causing application crashes.

  • Cheque printing through F110

    Hi Can anyone tell me, as how to link the bank cheques in F110 payment program. Regards Jyotsna

  • Graph Not Showing Up in Any Format

    Post Author: totai CA Forum: Exporting I have downloaded the trial version and created my first pie graph.  When I click any of the buttons to export (pdf, rtf, ppt) it opens the appropriate application but then all that shows up is the legend, no gr

  • Logging errors in PL/SQL Parser

    Using PL/SQL Parser, is it possible to obtain the parsing errors output in other place than a file (ref: setErrorLog function)? as varchar variables or kind? null

  • Prompt text

    hi all. i have two text items let say t1 and t2 i want when cursor on t1 so the prompt text should bold and when cursor on t2 so the t2 prompt text should be bold. when cursor on t2 then the t1 should be in normal text. is it possible? Forms 10G. OS