printf dont work

hallo;

i use printf but its not working ?

why???
#include <stdio.h>
#include <conio.h>
int main (void)
{
    short tabel[]={16,23,-7,10,85,-18,16,8};
    short i=0;
    short totaal=0;
    short kleinste=tabel[0];
    short temp=0;
    short size= sizeof(tabel)/sizeof(short);

     i=0;
     while (i < size)
     {
           temp=tabel[i];
           if (temp < kleinste)
           kleinste=temp;
     }
     printf("\n\n de kleinste getal in de tabel is %hd",kleinste);
     
    
    getchar();
    
}

Open in new window

kensy11Asked:
Who is Participating?
 
Infinity08Commented:
I just noticed that you're not incrementing i inside the loop, so the loop basically loops forever. You'll need to add a ++i somewhere near the end of the loop body.
0
 
Infinity08Commented:
What do you mean by "it's not working" ?

Does adding a \n at the end help ?

        printf("\n\n de kleinste getal in de tabel is %hd\n",kleinste);
0
 
Infinity08Commented:
Btw, main returns an int, so you also actually have to return an int value at the end of main (generally 0 to indicate success).
0
 
kensy11Author Commented:
when i run it or compile it i dont get any text its just a black screen
0
 
kensy11Author Commented:
oooh thank you i forgot to do it
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.