Help regarding program to display even numbers

plz send me a program to display even numbers from 1 to 100.

DATA : VAL TYPE I.
DO 100 TIMES.
COMPUTE VAL = SY-INDEX MOD 2.
IF VAL EQ 0.
WRITE : / 'Even NOs are' , SY-INDEX.
*ELSE.
*WRITE
ENDIF.
ENDDO.
REGARDS
SHIBA DUTTA

Similar Messages

  • Help Regarding a Picture Display in Customer Container.

    Hi,
    I am generating a ALV report output with an ICON in every  line to show the corresponding picture of the material in a Pop-up window.
    Now for displaying the picture at usercommand from ALV ,
    HTML browser is placed on the custom container screen and the URL is passed to the variable EDURL which helps in processing the material picture on the screen.
    The issues that  in this process is.. Picture pop-up currently shows briefly the previous picture before retrieving requested image .
    Please help me to solve this,
    Thanks
    Priyanka.

    Hi,
    While calling the pop up clear, refresh  all the variables and pass the new values.
    I guess when you are calling the Image for first time you are not getting any delay or previous image.
    So basically see the variables when calling for the first time and implement for the rest of times also.
    BR
    Dep

  • Help regarding programme to display internal programme inside the OS

    Can a programme be written in java which displays the number of internal processes running inside the operatingsystem with the click of a button.
    I found this link
    http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html#start()
    but not sure how to use it.

    That class is for invoking external programs. It doesn't let you examine arbitrary processes (at least not directly).
    If you have a program that can list running processes, and this program can be run from the command line, then you can use ProcessBuilder to run that program, and then examine its output to get the number of "internal processes" (it's not clear what you mean by "internal" there). Or you can use Runtime.exec, which is what people used before ProcessBuilder.
    I dimly recall hearing that utilities like this (listing various OS aspects from Java) are being supported better in JDK 1.6 but I don't recall the details.

  • Help, java programs cannot display properly

    Hello,
    I installed redhat 8.0 on my laptop ( Compaq Presario 1120, video
    card ATI Mobility Radeon 9000, not sure, how to check?). Then I
    installed j2re1.4.1, but when I run java program, it can only show
    the frame, just a frame.
    In the terminal, it gave the following message:
    java.lang.InternalError: not implemented yet
    at sun.awt.X11SurfaceData.getRaster(X11SurfaceData.java:155)
    at sun.java2d.loops.OpaqueCopyAnyToArgb.Blit(CustomComponent.java:67)
    at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:451)
    at sun.java2d.loops.MaskBlit$General.MaskBlit(MaskBlit.java:186)
    at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:749)
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2803)
    at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2793)
    If somebody knows what's the problem, please tell me, thanks!

    I had exactly the same problem with RH8.
    I fixed the swing problem by editing /etc/X11/XF86Config and adding
    the following line in the Screen section:
    DefaultFbBpp     32I restarted X (telinit 3; telinit 5 from root) and SwingSet2
    ran perfectly without any console exceptions.
    Thanks to Juergen Kreileder, Blackdown Java-Linux Team for this

  • Need urgent help in a simple java program that adds up even numbers and..

    The task is to write a program that allows the user to enter 8 integers and then displays the sum of the odd integers and the product of the even integers
    what i did so far is
    public class Computation
    private int n;
    private int even;
    private int odd;
    public Computation()
    even =0;
    odd = 1;
    public Computation(int num1, int num2, int num3,int num4,int num5,int num6,int num7, int num8)
    n = num1;
    n = num2;
    n = num3;
    n = num4;
    n = num5;
    n = num6;
    n = num7;
    n = num8;
    for(int i=0; i<=n; i++)
    if(n%2 == 0)
    even += n;
    else
    odd *=n;
    public int getEven(int n)
    return even;
    public int getOdd()
    return odd;
    import java.util.*;
    public class Tester
    public static void main(String [] args)
    System.out.println("Enter any three words");
    Scanner input = new Scanner(System.in);
    int num1 = input.nextInt();
    int num2 = input.nextInt();
    int num3 = input.nextInt();
    int num4 = input.nextInt();
    int num5 = input.nextInt();
    int num6 = input.nextInt();
    int num7 = input.nextInt();
    int num8 = input.nextInt();
    Computation compute = new Computation(num1, num2, num3, num4, num5, num6, num7, num8);
    System.out.println("The Summation of the even numbers is: " + compute.getEven( ) + "\n" +"The product of the odd numbers is: " + compute.getOdd());
    }The result i get is always zero.. however, i think the problem lies in the first class when i constructed the numbers and sat them all to one object "n",
    i need help in fixing this bug,,
    thanks

    7uSamx wrote:
    Can you illustrate by a small example please ?Any small example would already contain pretty much the entire code.
    You know how to declare a method, right? You have several in your code, so I assume you do.
    You already know how to check if a given variable is even or odd. You already showed that code, so I assume you do.
    Now put those two together and you'll have a method that decides if the value passed to it is even or odd.
    Now put the desired action in each of the branches of the if-statement and you're almost done.
    Now call the method with each method from your constructor and you're done.

  • Help with display of numbers

    First of all I have to say the tutorials on this site are extremely helpful. My instructor wants all our java code written as Object Oriented and when I did a search on here for Object Oriented it totally helped out. Now I just need help with the display of numbers, my code works perfectly fine except that the number has wayyyyyyyyyyy to many decimal points after it. I only wanted two.
    public class Mortgage
         double mtgAmount;
         double mtgTerm;
         double mtgRate;
         double monthPymt;
              public void Amount(double newValue)
                     mtgAmount = newValue;
              public double Amount()
                   return mtgAmount;
              public void Term(double newValue)
                     mtgTerm = newValue;
              public double Term()
                   return mtgTerm;
              public void Rate(double newValue)
                     mtgRate = newValue;
              public double Rate()
                   return mtgRate;
              public void calcmonthPymt(double newValue)                            //(LoanAmt * Rate) / (1- Math.pow(1+Rate,-Term));
                     monthPymt = (newValue);
              public void display()
              System.out.println ("The Mortgage Amount is:" +(Amount( ) * Rate( )) / (1- Math.pow(1+Rate( ),-Term( ))));
         public static void main (String[] args)
                     Mortgage Mortgage1=new Mortgage();
                     Mortgage1.Amount(200000);
                     Mortgage1.Term(360);
                     Mortgage1.Rate(.0575);
                     Mortgage1.display();
    }

    I figured it out, the math is wrong I think but I got everything to display correctly
    import java.io.*;
    import java.text.*;
    import java.text.DecimalFormat;
    public class Mortgage
         double mtgAmount;
         double mtgTerm;
         double mtgRate;
         double monthPymt;
         DecimalFormat money = new DecimalFormat("$0.00");
              public void Amount(double newValue)
                     mtgAmount = newValue;
              public double Amount()
                   return mtgAmount;
              public void Term(double newValue)
                     mtgTerm = newValue;
              public double Term()
                   return mtgTerm;
              public void Rate(double newValue)
                     mtgRate = newValue;
              public double Rate()
                   return mtgRate;
              public void calcmonthPymt(double newValue)                            //(LoanAmt * Rate) / (1- Math.pow(1+Rate,-Term));
                     monthPymt = (newValue);
              public void display()
              monthPymt = (Amount( ) * Rate( )) / (1- Math.pow(1+Rate( ),-Term( )));
              System.out.printf("The payment amount is:$%.2f", monthPymt);
              System.out.println();
         public static void main (String[] args)
                     Mortgage Mortgage1=new Mortgage();
                     Mortgage1.Amount(200000);
                     Mortgage1.Term(360);
                     Mortgage1.Rate(.0575);
                     Mortgage1.display();
    }

  • Help! iWeb won't open properly after I updated to Yosemite. No old websites, no workspace- nothing is displayed even when the app is open. HELP!

    Help! iWeb won't open properly after I updated to Yosemite. No old websites, no workspace- nothing is displayed even when the app is open. HELP!

    To open your domain file in Lion, Mountain Lion or Mavericks or to switch between multiple domain files Cyclosaurus has provided us with the following script that you can make into an Applescript application with AppleScript Editor. Open Script Editor, copy and paste the script below into Script Editor's window and save as an application.
    do shell script"/usr/bin/defaults write com.apple.iWeb iWebDefaultsDocumentPath -boolean no"
    delay 1
    tell application "iWeb" to activate
    You can download an already compiled version with this link: iWeb Switch Domain. Note:  you may have to Control (right) - click on the app after uncompressing and select Open due to the Sandboxing feature of OS X.  If you have problems with the app create your own with AppleScript Editor.
    Just launch the application, find and select the domain file in your Home/Library/Application Support/iWeb folder that you want to open and it will open with iWeb. It modifies the iWeb preference file each time it's launched so one can switch between domain files.
    WARNING: iWeb Switch Domain will overwrite an existing Domain.sites2 file if you select to create a new domain in the same folder.  So rename your domain files once they've been created to something other than the default name.
    NOTE: In Lion and Mountain Lion the Home/Library folder is now invisible. To make it permanently visible in Lion or Mt. Lion enter the following in the Terminal application window: chflags nohidden ~/Library and press the Return key - 10.7: Un-hide the User Library folder.
    For Mavericks and Yosemite go to your Home folder and use the View ➙ Show View Options menu to bring the this window:

  • Need help please adding odd even numbers

    here is my code
    import java.io.*;
    public class addeven
         public static void main(String args[])throws IOException
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              String n1;
              int num1;
              int r,x;
              System.out.print("Enter a number: ");
              n1=br.readLine();
              num1=Integer.parseInt(n1);
              r=num1%2;
              if (r==0)
                   System.out.println("Even number!");
              else
                   System.out.println("Odd number!");
    }my problem is how can i make a logic to add every even numbers
    example the user inputed number 10 and its even then the program will
    add every even number under number 10 and it will be 10+8+6+4+2
    then print the total how can i do that its not a homework im just selfstudy in java and im new to this language thank's

    > i think i found the loop for even but im going insane
    for odd wihs im good in looping
    import java.io.*;
    public class sumofeven
    public static void main(String args[])throws
    s IOException
    BufferedReader reader = new BufferedReader(new
    ew InputStreamReader(System.in));
              int x,sum = 0;
              System.out.print("Enter a number: ");
              x=Integer.parseInt(reader.readLine());
              for (int i=0; i<x; i=i+2)
                   sum=sum+i;
                   System.out.println(sum + "");
              }close, but yours does not check for even or odd. It would be better to do your sum by counting backward until you reach 0
    boolean even = false;
    System.out.print("Enter a number: ");
    num1=Integer.parseInt(br.readLine());
    if(num1%2 == 0) even = true;
    int orig = num1;
    while(num1 > 0)
        sum += num1;
        num1 -= 2;
    }~Tim

  • Hi, I have an iPhone 4 which rings people when it is locked, whether or not in my pocket.  I always lock it when not using it.  Can anyone help? It is calling random numbers, not the last person or anyone even recently called on my recents list. Thanks

    Hi, I have an iPhone 4 which rings people when it is locked, whether or not in my pocket.  I always lock it when not using it.  Can anyone help? It is calling random numbers, not the last person or anyone even recently called on my recents list. Thanks

    Pay no attention to iinami, the amount of replies to people saying their handsets must have been jailbroken everytime iTunes throws out an error is tremendous. (Clearly you don't need to have any real knowledge to get to level 3 on these forums, let's hope apple's geniuses know a lot more than some of their customers.)
    http://support.apple.com/kb/TS3694
    Solution below.
    Error 9
    This error occurs when the device unexpectedly loses its USB connection with iTunes. This can occur if the device is manually disconnected during the restore process. This issue can be resolved by performing USB troubleshooting, using a different USB dock-connector cable, trying another USB port, restoring on another computer, or by eliminating conflicts from third-party security software.

  • In finder, under favorites it displays a numbers file.  I can't delete it. Help.

    In finder, under favorites it displays a numbers file.  I can't click on it. The file has been removed from my computer.  How do I remove this off my favorites menu? How did it get there? Thanks

    SOLVED!
    Thank you! The swooshing (close enough, huh?) cloud was fantastic! It was like that for over a year!
    Thanks much.
    ManManus -ider..
    Message was edited by: Macmanusider

  • Error message "This program cannot display the webpage when uploading images to Cafe Press

    I have had a Café Press shop for five years and except for sometimes being slow, no problems uploading images. Now, suddenly for 3 days I get the message "This program cannot display the webpage
    Most likely causes:
    • You are not connected to the Internet.
    • The website is encountering problems.
    • There might be a typing error in the address.
    What you can try:
    Check your Internet connection. Try visiting another website to make sure you are connected.
    Retype the address."
    I got the messsage about half way through the uploading of an image. People suggested using "firefox" instead of IE so I now get a similar error message from Firefox. I signed in, clicked on the image I wanted to upload and hit "upload" and get message as follows:
    Server not found
    Firefox can't find the server at members.cafepress.com.
    * Check the address for typing errors such as
    ww.example.com instead of
    [url=http://www.example.com]www.example.com[/url]
    * If you are unable to load any pages, check your computer's network connection.
    * If your computer or network is protected by a firewall or proxy, make sure that Firefox is permitted to access the Web.
    None of this makes sense because I WAS connected to the internet (obviously) or I wouldn't have been able to sign in, go to my media basket, browse for the image and click "upload" and watch as the progress bar showed percentage of upload such as 20%, etc. and even went to 100% at times before giving me the error message. Plus I couldn't make a typing error since I wasn't typing anything but uploading an image. Any suggestions?
    Whatever your suggestion, I need step by step instructions as I am totally computer illiterate. I don't even know what a "proxy" is and don't know if I have a "firewall" as the message suggests. I have "Comodo" security and am using Windows XP.
    I contacted CP which was no help at all. All they did was tell me to clear my cache which I do after every session. Thanks
    Nancy
    http://www.cafepress.com/calendarflr

    Sounds like your desktop application is in fact running from
    a server. CHMs were identified as a security risk by Microsoft and
    are best suited to the user's PC.
    Click
    here for more information.

  • How to display page numbers in report

    hi all,
    i would like to know how to display page numbers in this format " 1 of 5" in the report.
    Any help would be much appreciated.
    thanks
    seema

    Hi,
    Check this too...
    Page No. in ALV output
    If you query is solved, kindly close the thread.
    Regards,
    Anjali
    Message was edited by: Anjali Devi Vishwanathan

  • Search help with programming

    Hai,
    Can any one give example for search help with Programming?
    I hope we can create search help with help of coding.
    With Regards,Jaheer.

    yes u can create search help by using match code in programs
    for eq
    go with abap editor se 38
    provide the name of program
    parameters : vendor like lfa1-lifnr matchcode object yzob.
    double click on yzob
    provide description for search help
    provide selection method
    provide search help parameter
    enable check box for import and export
    provide lpos
               spos
    save check activate
    press f4 for check and import values i.e it will display a records list available in database table
    rewards points please

  • Regarding Table data display

    Hi experts,
    I have one ztable having some fields, the end user will not have authorize for (SE11 and SE16) . I want to make program for display that table data. And also want put filter options( Select-options) for all fields, User wants select some fields based on that fields want display all data from that table.  How can i do this?
    Please help me? Any coding?
    Thanks and Regards,
    Linganathan.K
    Moderator message : Not enough re-search  before posting, discussion locked.
    Message was edited by: Vinod Kumar

    Dear Linganathan,
    It is purely based on your requirement.
    1. If the users are strictly restricted for SE11 and SE16 then  table generator would be a probable option
    2. However, when you restrict SE11 and Se16 I do not think so you will give SM30 also...
    3. Are you allow user to maintain/edit the table?
    3. Do you want to provide selection parameter...
    Based on this, probably you should go for a small report program that displays data in the ALV format accepting the input parameters as selection range.
    Regards,
    Venkat

  • Need help regarding the dunning form

    Hi,
    I have to display all the sales and payments of a cusomter for all the periods that are older than the run date in a dunning form. (i.e) if the run date is 04-aug-05 and if the slaes are there in 3 months(april, May, july) then i have to display three line items with sales and payments for that corresponding three months in the line items. As this is a dunning form i cannot change the print program. any table which have all the sales for a period which i can access directly in the script. can anyone suggest how to handle this.
    regards,
    Asha

    Hi,
    You can call a subroutine within a program (your z program)
    /:   PERFORM ADD_AMOUNT IN PROGRAM SAPLZFTP_F150
    /:           USING &W_AMOUNT&
    /:   ENDPERFORM
    In the z program create this subroutine.
          Form ADD_AMOUNT
         -->FT_INVAR  Text Symbol table for input  variables
         -->FT_OUTVAR Text Symbol table for output variables
    FORM add_amount TABLES ft_invar   STRUCTURE itcsy
                           ft_outvar  STRUCTURE itcsy.
      STATICS:
        w_value_l    TYPE  f150d-salfw.
            READ TABLE ft_invar INDEX 1.
            IF sy-subrc IS INITIAL.
    you can check all this part of the code how you want to
    process your data whether its numeric or character or
    whatever
               w_value_l = w_value_l + ft_invar-value.
            ENDIF. "IF sy-subrc IS INITIAL.
    ENDFORM.                    " ADD_AMOUNT
    TO BESPOKE THE PRINT PROGRAM FOR THE DUNNING
    Dunning outputs use the function module FI_DUNNING_PRINT_NOTICE. You can copy this to a Z function module and make some changes to the data selection. You will have to look into the code and decide what changes you need.
    The process to use a bespoke program to do the dunning print is as follows:
    UNDER FI GLOBAL SETTINGS in the configuration,
    There are Business Transaction Events. Within that you can configure the same to enable a Z function module in place of the standard function module (from the FUNCTION GROUP F150)
    • Create function group ZFTP_F150
    • Copy standard function module FI_PRINT_DUNNING_NOTICE of function group F150 to ZFTP_FI_PRINT_DUNNING_NOTICE in function group ZFTP_F150
    • Copy standard function module PRINT_DUNNING_NOTICE of function group F150 to ZFTP_PRINT_DUNNING_NOTICE in function group ZFTP_F150
    • Within the function module ZFTP_FI_PRINT_DUNNING_NOTICE, change function module call for PRINT_DUNNING_NOTICE to ZFTP_PRINT_DUNNING_NOTICE
    • Create a new include ZFTPI_ROUTINES within the function group and copy the subroutines LOG_MSG, LOG_MSG_TAB, & LOG_SYMSG from the function group F150 to this include
    AS AN ALTERNATE, YOU CAN COPY THE WHOLE FUNCTION GROUP
    • Maintenance view TBE31 (SM30). Change the function module from FI_PRINT_DUNNING_NOTICE to ZFTP_FI_PRINT_DUNNING_NOTICE against the event 00001720 FI-FI entry
    Hope this helps.
    regards,
    Satya

Maybe you are looking for