Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with the output of this program?
New Posts  All Forums:Forum Nav:

Help with the output of this program?

post #1 of 4
Thread Starter 
Hey all. I'm a noob and I need help with the following question:
Quote:
Write the output from the following pseudo-code.
FOR (n:=1, n<=5, +2)
FOR(m=1, m
Display “Output is ”, m*n
ENDFOR
Display “Next Loop”
ENDFOR


Can someone explain it to me? Help is greatly appreciated. redface.gif
Edited by vinton13 - 7/22/12 at 4:24pm
AMD Build
(16 items)
 
Intel Build
(9 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-8120 @ 4.3GHz GIGABYTE GA-990FXA-UD7 GIGABYTE Radeon HD 7950 CrossFired G.SKILL Sniper 1600MHz 2x4GB 
Hard DriveHard DriveCoolingOS
Crucial 64GB m4 1TB WD Black CM Hyper 212+ Windows 7 x64 Ultimate 
MonitorKeyboardPowerCase
Dell UltraSharp U2713HM 27" 2560 x 1440 Logitech MK700 Corsair AX850 CM 690II 
MouseAudio
Logitech MX620 Asus Xonar D1 + JVC RX700 
CPUMotherboardGraphicsRAM
Intel Core i7-3770K ASRock Z77 Extreme4 None yet G.SKILL Sniper 1600MHz 2x4GB  
Hard DriveOSMonitorPower
Samsung 840 250GB Windows 8 x64 Proessional Samsung 2233BW 21.5" (1080p) CORSAIR Professional Series Gold AX750 
Case
CM 690II 
CPUGraphicsRAMHard Drive
AMD A6-3420M AMD Radeon 6520G Hyundai+Kingston 8GB [2x4GB] 1333MHz Hitachi 750GB 5400RPM 
OS
Windows 8 Professional x64 
  hide details  
Reply
AMD Build
(16 items)
 
Intel Build
(9 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-8120 @ 4.3GHz GIGABYTE GA-990FXA-UD7 GIGABYTE Radeon HD 7950 CrossFired G.SKILL Sniper 1600MHz 2x4GB 
Hard DriveHard DriveCoolingOS
Crucial 64GB m4 1TB WD Black CM Hyper 212+ Windows 7 x64 Ultimate 
MonitorKeyboardPowerCase
Dell UltraSharp U2713HM 27" 2560 x 1440 Logitech MK700 Corsair AX850 CM 690II 
MouseAudio
Logitech MX620 Asus Xonar D1 + JVC RX700 
CPUMotherboardGraphicsRAM
Intel Core i7-3770K ASRock Z77 Extreme4 None yet G.SKILL Sniper 1600MHz 2x4GB  
Hard DriveOSMonitorPower
Samsung 840 250GB Windows 8 x64 Proessional Samsung 2233BW 21.5" (1080p) CORSAIR Professional Series Gold AX750 
Case
CM 690II 
CPUGraphicsRAMHard Drive
AMD A6-3420M AMD Radeon 6520G Hyundai+Kingston 8GB [2x4GB] 1333MHz Hitachi 750GB 5400RPM 
OS
Windows 8 Professional x64 
  hide details  
Reply
post #2 of 4
Code:
--Write the output from the following pseudo-code.

    FOR (n:=1, n<=5, n =+ 2)
      
       FOR(m=1, m     )          ????                
            Display “Output is ”, m*n 
       ENDFOR

       Display “Next Loop”

    ENDFOR


I don't think that you have copied that right, the first for should have n+=2 ?

???? - What is that ment to say.


edit. there seems to be a bug on the forum when submitting code snip-its.
Edited by andrewmchugh - 7/22/12 at 4:22pm
Andr3w's RiG
(16 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i7 920 @ 4.0 (HT off) ASUS P6TD Deluxe EVGA GTX 580 SC 6GB Corsair XMS3 1600 
Hard DriveCoolingCoolingCooling
2x RAID0 OCZ VERTEX2 SSD 60GB EK FC580GTX EK Supreme HF Laing D5 
OSMonitorKeyboardPower
Windows 7 64 bit / Fedora 16 / Mint 13 DELL S2209W Ducky 9008S MX RED with white LED CORSAIR AX850 
CaseMouseMouse PadOther
Antec 1200 Microsoft X8 Steelseries QcK Pro Creative XFi 
CPUGraphicsRAMHard Drive
Core i7 @ 2.6  GT650 16GB of 1600 MHz DDR3L SDRAM 256GB SSD 
OSMonitorKeyboard
Mac OSX Lion Retina Display US layout 
  hide details  
Reply
Andr3w's RiG
(16 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i7 920 @ 4.0 (HT off) ASUS P6TD Deluxe EVGA GTX 580 SC 6GB Corsair XMS3 1600 
Hard DriveCoolingCoolingCooling
2x RAID0 OCZ VERTEX2 SSD 60GB EK FC580GTX EK Supreme HF Laing D5 
OSMonitorKeyboardPower
Windows 7 64 bit / Fedora 16 / Mint 13 DELL S2209W Ducky 9008S MX RED with white LED CORSAIR AX850 
CaseMouseMouse PadOther
Antec 1200 Microsoft X8 Steelseries QcK Pro Creative XFi 
CPUGraphicsRAMHard Drive
Core i7 @ 2.6  GT650 16GB of 1600 MHz DDR3L SDRAM 256GB SSD 
OSMonitorKeyboard
Mac OSX Lion Retina Display US layout 
  hide details  
Reply
post #3 of 4
Thread Starter 
You're right. Its messed up and I didn't even realize. Here is a screen cap of it.

AMD Build
(16 items)
 
Intel Build
(9 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-8120 @ 4.3GHz GIGABYTE GA-990FXA-UD7 GIGABYTE Radeon HD 7950 CrossFired G.SKILL Sniper 1600MHz 2x4GB 
Hard DriveHard DriveCoolingOS
Crucial 64GB m4 1TB WD Black CM Hyper 212+ Windows 7 x64 Ultimate 
MonitorKeyboardPowerCase
Dell UltraSharp U2713HM 27" 2560 x 1440 Logitech MK700 Corsair AX850 CM 690II 
MouseAudio
Logitech MX620 Asus Xonar D1 + JVC RX700 
CPUMotherboardGraphicsRAM
Intel Core i7-3770K ASRock Z77 Extreme4 None yet G.SKILL Sniper 1600MHz 2x4GB  
Hard DriveOSMonitorPower
Samsung 840 250GB Windows 8 x64 Proessional Samsung 2233BW 21.5" (1080p) CORSAIR Professional Series Gold AX750 
Case
CM 690II 
CPUGraphicsRAMHard Drive
AMD A6-3420M AMD Radeon 6520G Hyundai+Kingston 8GB [2x4GB] 1333MHz Hitachi 750GB 5400RPM 
OS
Windows 8 Professional x64 
  hide details  
Reply
AMD Build
(16 items)
 
Intel Build
(9 items)
 
 
CPUMotherboardGraphicsRAM
AMD FX-8120 @ 4.3GHz GIGABYTE GA-990FXA-UD7 GIGABYTE Radeon HD 7950 CrossFired G.SKILL Sniper 1600MHz 2x4GB 
Hard DriveHard DriveCoolingOS
Crucial 64GB m4 1TB WD Black CM Hyper 212+ Windows 7 x64 Ultimate 
MonitorKeyboardPowerCase
Dell UltraSharp U2713HM 27" 2560 x 1440 Logitech MK700 Corsair AX850 CM 690II 
MouseAudio
Logitech MX620 Asus Xonar D1 + JVC RX700 
CPUMotherboardGraphicsRAM
Intel Core i7-3770K ASRock Z77 Extreme4 None yet G.SKILL Sniper 1600MHz 2x4GB  
Hard DriveOSMonitorPower
Samsung 840 250GB Windows 8 x64 Proessional Samsung 2233BW 21.5" (1080p) CORSAIR Professional Series Gold AX750 
Case
CM 690II 
CPUGraphicsRAMHard Drive
AMD A6-3420M AMD Radeon 6520G Hyundai+Kingston 8GB [2x4GB] 1333MHz Hitachi 750GB 5400RPM 
OS
Windows 8 Professional x64 
  hide details  
Reply
post #4 of 4
Start by getting a piece of paper and write down the values of n and m, and then cross them out and writing the new values as you go through the loops.
Andr3w's RiG
(16 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i7 920 @ 4.0 (HT off) ASUS P6TD Deluxe EVGA GTX 580 SC 6GB Corsair XMS3 1600 
Hard DriveCoolingCoolingCooling
2x RAID0 OCZ VERTEX2 SSD 60GB EK FC580GTX EK Supreme HF Laing D5 
OSMonitorKeyboardPower
Windows 7 64 bit / Fedora 16 / Mint 13 DELL S2209W Ducky 9008S MX RED with white LED CORSAIR AX850 
CaseMouseMouse PadOther
Antec 1200 Microsoft X8 Steelseries QcK Pro Creative XFi 
CPUGraphicsRAMHard Drive
Core i7 @ 2.6  GT650 16GB of 1600 MHz DDR3L SDRAM 256GB SSD 
OSMonitorKeyboard
Mac OSX Lion Retina Display US layout 
  hide details  
Reply
Andr3w's RiG
(16 items)
 
   
CPUMotherboardGraphicsRAM
Intel Core i7 920 @ 4.0 (HT off) ASUS P6TD Deluxe EVGA GTX 580 SC 6GB Corsair XMS3 1600 
Hard DriveCoolingCoolingCooling
2x RAID0 OCZ VERTEX2 SSD 60GB EK FC580GTX EK Supreme HF Laing D5 
OSMonitorKeyboardPower
Windows 7 64 bit / Fedora 16 / Mint 13 DELL S2209W Ducky 9008S MX RED with white LED CORSAIR AX850 
CaseMouseMouse PadOther
Antec 1200 Microsoft X8 Steelseries QcK Pro Creative XFi 
CPUGraphicsRAMHard Drive
Core i7 @ 2.6  GT650 16GB of 1600 MHz DDR3L SDRAM 256GB SSD 
OSMonitorKeyboard
Mac OSX Lion Retina Display US layout 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Help with the output of this program?