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 / kanakaraju

#include< stdio.h>
#include<conio.h>
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

What is a rvalue?

1142


Explain how do you print only part of a string?

1163


What is union in c?

1062


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1899


What is the use of volatile?

1046


How to declare pointer variables?

1170


What is an arrays?

1031


What are types of functions?

977


What is auto keyword in c?

1162


What is the use of ?: Operator?

1082


What is #ifdef ? What is its application?

1057


Explain how does flowchart help in writing a program?

1064


What is data types?

1026


Explain how do you convert strings to numbers in c?

1024


Why we not create function inside function.

2145