Given two programmes are same ???

if yes then try both with these inputs 4 2 3 -1 4 -1 -2 4
i am getting different answers :/

don't know why??
plz help
Code:
#include<stdio.h>
 int main()
 {
 int x,i=1,sum=0;
 /*printf("no. of numbers");*/
 /*scanf("%d",&n);*/
 for(i=0;i<5;i++)
 {
 printf("enter the values");
 scanf("%d",&x);
 if(x<0)
 {
 continue;
 }
 sum+=x;

 }
 printf("%d",sum);
 }

----------------------------------------------------------------------------------------------------------------


#include<stdio.h>
 int main()
 {
 int x,i=1,sum=0;
 /*printf("no. of numbers");*/
 /*scanf("%d",&n);*/
 for(i=0;i<5;)
 {
 printf("enter the values");
 scanf("%d",&x);
 if(x<0)
 {
 continue;
 }
 sum+=x;
i+=1;
 }
 printf("%d",sum);
 }

Last edited by shabbir; 26Oct2012 at 10:30.. Reason: Code blocks