Sunday, 22 October 2017

Calculating Average of Numbers

#include<stdio.h>
int mainint argc, char *argv[] )
{
    int i , sum 0;
    float j;
    for(1argci++ )
    {
        sum = sum + atoi(argv[i]);
    }
    j = (float)sum / (argc 1);
    printf("%.2f",j);
    return 0;


}

No comments:

Post a Comment

Featured Post

TCS Latest Test Patern ( For On-Campus Drives )

Tata Consultancy Services is software services consulting company whose  headquarter is situated in Mumbai, India. It is the Asia’s larges...