F
fattaneh
hi all ,
i have written this code , and it should be in while if num is not
zero
so it shouldn't print error , but num becomes zero and it wont come
out of while
i have written this code in visual studio c++
#include "stdafx.h"
#include <stdio.h>
using namespace System;
int main(array<System::String ^> ^args)
{
int num =5 ;
while (num !=0)
{
num-- ;
if(num ==0)
{
printf("error") ; // it should never write this but it
will write .
}
}
return 0;
}
could you help me to filnd out what the problem is ?
thanks of all . . .
i have written this code , and it should be in while if num is not
zero
so it shouldn't print error , but num becomes zero and it wont come
out of while
i have written this code in visual studio c++
#include "stdafx.h"
#include <stdio.h>
using namespace System;
int main(array<System::String ^> ^args)
{
int num =5 ;
while (num !=0)
{
num-- ;
if(num ==0)
{
printf("error") ; // it should never write this but it
will write .
}
}
return 0;
}
could you help me to filnd out what the problem is ?
thanks of all . . .