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

Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop

2209


How can I swap two values without using a temporary?

1155


What do you mean by a sequential access file?

1136


What is a buffer in c?

1056


Write a code to generate divisors of an integer?

1105


Write a program on swapping (100, 50)

1167


Write a code to determine the total number of stops an elevator would take to serve N number of people.

1309


What is a program flowchart and how does it help in writing a program?

1190


What is "Hungarian Notation"?

1169


What is the importance of c in your views?

1238


What the advantages of using Unions?

1294


List a few unconditional control statement in c.

1029


Why does the call char scanf work?

1261


Is fortran still used in 2018?

1094


What is clrscr ()?

1175