Thread: Help me 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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

Popular pages Recent additions subscribe to a feed