Click here to Skip to main content
15,867,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: ChartFX Compatiability Pin
David Crow24-Oct-12 6:05
David Crow24-Oct-12 6:05 
AnswerRe: ChartFX Compatiability Pin
Andrew Hoole24-Oct-12 6:24
Andrew Hoole24-Oct-12 6:24 
GeneralRe: ChartFX Compatiability Pin
Andrew Hoole24-Oct-12 22:00
Andrew Hoole24-Oct-12 22:00 
AnswerRe: ChartFX Compatiability Pin
krmed24-Oct-12 7:12
krmed24-Oct-12 7:12 
AnswerRe: ChartFX Compatiability Pin
Gary Qiu25-Oct-12 5:46
Gary Qiu25-Oct-12 5:46 
Questionthe program exit after creating process in the solaris Pin
jonesliu24-Oct-12 0:51
jonesliu24-Oct-12 0:51 
AnswerRe: the program exit after creating process in the solaris Pin
Richard MacCutchan24-Oct-12 1:06
mveRichard MacCutchan24-Oct-12 1:06 
QuestionFinding Min and Max of array Pin
Mikerush723-Oct-12 6:50
Mikerush723-Oct-12 6:50 
Hi. I have assignment to find difference between Min and Max of an array of 5 numbers. I did some work, but after compiling - my program does not run, it just stops working.. Can you help me, where is my mistake ? Array values needs to be double.

#include <stdio.h>
#include <stdlib.h>

int main()
{
int i;            // element in array 
int size;            // size of array
double array [i];    // number of elements in array
double min;          //minimum value
double max;          // maximum value
double difference;   // difference between maximum and minimum values

 printf("Enter the size of the array: ");
 scanf("%d",&size);
 printf("Enter %d elements in to the array: ", size);
 scanf("%d",&array[i]);
       
max = array[0];  // let first number in array be maximum
for (i=0; i<size; i++)
if (max < array [i])
    max = array [i];
    {
        printf("Maximum value is: %d\n",max);
    }
    
min = array [0]; // let first number in array be minimum
for (i=0; i<size; i++)
    if (min>array[i])
    min = array [i];
    {
      printf("Minimum value is: %d\n",min);
    }       

difference = max - min;

printf ("Difference between Min and Max values is %d\n", difference);

/*   if (i>= 5)
   {
   printf ("Only 5 numbers allowed. \n");
   break;
   }
*/

  
  system("PAUSE");	
  return 0;
}

AnswerRe: Finding Min and Max of array Pin
jeron123-Oct-12 7:36
jeron123-Oct-12 7:36 
AnswerRe: Finding Min and Max of array Pin
Chris Losinger23-Oct-12 8:31
professionalChris Losinger23-Oct-12 8:31 
AnswerRe: Finding Min and Max of array Pin
CPallini23-Oct-12 10:47
mveCPallini23-Oct-12 10:47 
AnswerRe: Finding Min and Max of array Pin
«_Superman_»23-Oct-12 19:34
professional«_Superman_»23-Oct-12 19:34 
AnswerRe: Finding Min and Max of array Pin
Sajeesh Payolam23-Oct-12 20:10
Sajeesh Payolam23-Oct-12 20:10 
GeneralRe: Finding Min and Max of array Pin
Mikerush724-Oct-12 3:28
Mikerush724-Oct-12 3:28 
QuestionHow to delete Registry Key with Maximum rights Pin
platso_58823-Oct-12 2:40
platso_58823-Oct-12 2:40 
AnswerRe: How to delete Registry Key with Maximum rights Pin
Jochen Arndt23-Oct-12 3:02
professionalJochen Arndt23-Oct-12 3:02 
GeneralRe: How to delete Registry Key with Maximum rights Pin
platso_58824-Oct-12 5:17
platso_58824-Oct-12 5:17 
GeneralRe: How to delete Registry Key with Maximum rights Pin
Jochen Arndt24-Oct-12 5:45
professionalJochen Arndt24-Oct-12 5:45 
GeneralRe: How to delete Registry Key with Maximum rights Pin
platso_58824-Oct-12 20:27
platso_58824-Oct-12 20:27 
GeneralRe: How to delete Registry Key with Maximum rights Pin
Jochen Arndt24-Oct-12 21:15
professionalJochen Arndt24-Oct-12 21:15 
Questionmessage CBN_SELENDOK not sent when using mouse Pin
NoviceEx23-Oct-12 2:07
NoviceEx23-Oct-12 2:07 
AnswerRe: message CBN_SELENDOK not sent when using mouse Pin
Jochen Arndt23-Oct-12 2:51
professionalJochen Arndt23-Oct-12 2:51 
GeneralRe: message CBN_SELENDOK not sent when using mouse Pin
NoviceEx23-Oct-12 3:05
NoviceEx23-Oct-12 3:05 
GeneralRe: message CBN_SELENDOK not sent when using mouse Pin
Jochen Arndt23-Oct-12 3:23
professionalJochen Arndt23-Oct-12 3:23 
GeneralRe: message CBN_SELENDOK not sent when using mouse Pin
NoviceEx23-Oct-12 21:48
NoviceEx23-Oct-12 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.