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 convert an char array to decimal array

Answer Posted / raj

main()
{
int a[5];
char c[5]={'1','2','3','4','5'};
int i;
for(i=0;i<5;i++)
a[i]=c[i]-'0';
for(i=0;i<5;i++)
printf("%d ",a[i]);
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

if p is a string contained in a string?

1832


Why & is used in c?

1161


What is integer constants?

1061


what type of questions arrive in interview over c programming?

2017


Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

5191


Explain how can you determine the size of an allocated portion of memory?

1096


Can math operations be performed on a void pointer?

1034


Do you know the difference between malloc() and calloc() function?

1042


#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }

1105


What is a structure member in c?

992


How is a null pointer different from a dangling pointer?

1006


What's the difference between constant char *p and char * constant p?

1136


What is the use of #include in c?

1070


How can I get random integers in a certain range?

1046


How can a process change an environment variable in its caller?

1174