what is the diference between these two codes ? i m not able to figure out.

#include<stdio.h>
int main()
{
int t,n,r,sum;
scanf("%d",&t);
while(t–)
{
sum=0;
scanf("%d",&n);
while(n>0)
{
r=n%10;
sum=sum+r;
n=n/10;
}
printf("%d\n",sum);
}
}

second code
#include<stdio.h>
int main()
{int t,n,a=0,s=0,i;
printf(“enter the no of test cases”); printf("\n");
printf("\n");
scanf("%d",&t);
while(t–)
{ printf(“enter the number “);
printf(”\n”);
scanf("%d",&n);
printf("\n");
s=0;a=0;
while(n>0)
{
a=n%10;
s=s+a;
n=n/10;
}
printf(“sum of digits=%d”,s);
printf("\n");

  }
return 0;}

Dont use random print statements, its a machine checking your output to be exact match of expected output. Output ONLY whats asked and in that format only.