Average of Two Numbers using Command Line Arguments

Find the Average of Two numbers using Command Line Language

Note: Please go through Command Line Arguments Post before preparing for these questions. The theory there  for TCS command line Program will help you in better understanding .

#include <stdio.h>

int main(int argc, char * argv[])
{
 int sum = 0,i = 1,count = 0;
 if(argc == 1)
 {
 printf("Enter the number \n");
 exit(1);
 }
 count = argc - 1;
 while (i <= count )
 {
 sum += atoi (argv[i]) ;
 i++;
 }
 printf("Avg of the numbers.%d\n", sum/count);
}