ALL C-PROGRAMES
Menu
Cpp Intro
All C Programs
Showing posts with label
String to integer
.
Show all posts
Showing posts with label
String to integer
.
Show all posts
Tuesday, 23 June 2015
WRITE A C PROGRAM TO CONVERT A STRING LIKE 123 TO AN INTEGER 123
#include<stdio.h>
main()
{
int i;
char str1[10];
printf("Enter a string of numeric values : ");
scanf("%s",str1);
i=atoi(str1);
printf("\n The result is %d",i);
}
OUTPUT
Enter a string of numeric value : 123
the result is 123
Older Posts
Home
Subscribe to:
Posts (Atom)