Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how to find sum of digits in C?

Answer Posted / leelanarasimhareddy

void main()
{
int a[20];
printf("enter no of values");
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
printf("%d",sum);
}

Is This Answer Correct ?    63 Yes 86 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an operator?

1128


Hi can anyone tell what is a start up code?

2138


Write a program to print fibonacci series without using recursion?

1219


What is the difference between fread buffer() and fwrite buffer()?

1227


What is a macro, and explain how do you use it?

1126


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

1105


Explain pointer. What are function pointers in C?

1145


What is the auto keyword good for?

1231


Are there any problems with performing mathematical operations on different variable types?

1105


What is the method to save data in stack data structure type?

1147


write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a

2007


Why do we need functions in c?

1082


Why is struct padding needed?

1158


Can we use any name in place of argv and argc as command line arguments?

1125


what type of questions arrive in interview over c programming?

2083