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

Linked lists -- can you tell me how to check whether a linked list is circular?

1097


What is variable in c example?

1082


What is c system32 taskhostw exe?

1034


Distinguish between actual and formal arguments.

1088


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

1168


Difference between malloc() and calloc() function?

1213


What does *p++ do? What does it point to?

1069


In C language, a variable name cannot contain?

1283


Where we use clrscr in c?

1142


How can you find the day of the week given the date?

1206


How reliable are floating-point comparisons?

1108


what will be the output for the following main() { printf("hi" "hello"); }

11023


What is the use of ?: Operator?

1141


How do we print only part of a string in c?

1032


What are actual arguments?

1108