Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Managed C++/CLI
  4. C++

C++

Scheduled Pinned Locked Moved Managed C++/CLI
c++question
4 Posts 4 Posters 4 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hukdup
    wrote on last edited by
    #1

    :confused:I need to write a program that reads n from the keyboard and prints on the screen the sum of numbers 1 + 4 + 7 + ... + (3n-2). Compile it and run it What is the result for n=7 and n=98

    M A 2 Replies Last reply
    0
    • H Hukdup

      :confused:I need to write a program that reads n from the keyboard and prints on the screen the sum of numbers 1 + 4 + 7 + ... + (3n-2). Compile it and run it What is the result for n=7 and n=98

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      huh! where's the programming question please ? write some code, and we'll be happy to help you ! say that it's not a homework assigment !? Max

      B 1 Reply Last reply
      0
      • M Maximilien

        huh! where's the programming question please ? write some code, and we'll be happy to help you ! say that it's not a homework assigment !? Max

        B Offline
        B Offline
        benjymous
        wrote on last edited by
        #3

        the "compile it and run it" line at the end makes it look like homework to me! -- Help me! I'm turning into a grapefruit!

        1 Reply Last reply
        0
        • H Hukdup

          :confused:I need to write a program that reads n from the keyboard and prints on the screen the sum of numbers 1 + 4 + 7 + ... + (3n-2). Compile it and run it What is the result for n=7 and n=98

          A Offline
          A Offline
          Alexandru Savescu
          wrote on last edited by
          #4

          Here's the program: int n; cin >> n; cout << "The result is" << (3 * n * n - n)/2 << endl; Best regards, Alexandru Savescu

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups