C program to convert string to Integer

C program to convert string to Integer:
If you are using any software then below program will not give an error, but if you are using TURBO C then you have to make some changes like: void main() and some function like clrscr() or getch().


   int no;
   char num[3];

   printf("Please Enter Number : ");

   //Convert String to Integer
   printf("\nString To Integer : %d",no);


Please Enter Number : 45

String To Integer : 45


Leave a Reply

Your email address will not be published. Required fields are marked *