Help me out!

This is a discussion on Help me out! within the C Programming forums, part of the General Programming Boards category; This program needs to read the integer and then allow that many integers to be entered and then print out ...

  1. #1
    Registered User
    Join Date
    Feb 2009
    Location
    Indiana
    Posts
    99

    Help me out!

    This program needs to read the integer and then allow that many integers to be entered and then print out the smallest number. This is what we have.

    Code:
    #include <stdio.h>
    
    int main () {
    
    	int integer;
    	int min;
    	int counter;
    
    	printf("Enter integer\t");
    	scanf("%d", &integer);
    
    
    	counter = 0;
    	min = ;
    	counter++;
    	
    	if(integer > counter){ 
    		min = min;
    
        printf("Enter integer\t");
    	scanf("%d", &integer);
    	counter++;}
    	
    	else(integer == counter);
    		printf("The smallest integer is %d\n", min);
    
    	
    
    	return 0;
    }

  2. #2
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    my reply is (or will be) in the other thread you made about this

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    58
    Code:
    min = min;
    That isn't helping.

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

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