CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Lightbulb please help me solving this problem

    i m new to Programming. Please help me solving this Question .. thanks .. i m doing this like ... having some logical error

    Assuming the ocean’s level is currently rising at about 1.5 millimeters per year; write a program that displays a table
    showing the number of millimeters that the ocean will have risen each year for the next 25 years.


    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                double rate = 1.55;
                for (double year = 1; year <= 25; year++)
                {
                
                    rate = rate * year;
    
                    Console.WriteLine(rate);
                    
                }
    
                
                    
            }
        }
    }
    Last edited by BioPhysEngr; April 29th, 2012 at 05:59 PM. Reason: code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured