C++ Problem Solving

This is a discussion on C++ Problem Solving within the C++ Programming forums, part of the General Programming Boards category; Yeah its working now, thanks a lot for help - even if it was probably one of the most basic ...

  1. #16
    Registered User
    Join Date
    Oct 2007
    Posts
    4
    Yeah its working now, thanks a lot for help - even if it was probably one of the most basic problems you've seen on these boards xD

    Code:
    #include "stdafx.h"
    #include <iostream>
    using namespace std;
    
    int main ()
    {
      int NumEls[5] = {23, 54, 29, 35, 40};
      int * pVals;
      pVals = NumEls;
      int max = NumEls[0];
    	
    	for (int i = 1 ; i < 5 ; i++ ) 
    	{
    		if (max < NumEls[i]) 
    		max = NumEls[i];
    	}
      
    	cout << "Maximum element in the array :   " << max;
    
      return 0;
    }

  2. #17
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Quote Originally Posted by scojan View Post
    one of the most basic problems you've seen on these boards xD
    Not by far.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 07:54 PM
  2. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  3. JOB: C/C++ Developer with problem solving skills
    By VoltRecruiter in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 01-26-2006, 12:25 AM
  4. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  5. Sign-up Thread: Problem Solving #1
    By ygfperson in forum Contests Board
    Replies: 15
    Last Post: 01-26-2003, 02:55 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21