About Me

My photo
Raipur, Chhattisgarh, India
Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.

Tuesday, August 27, 2013

String Program : Program to Convert String to Integer


#include<stdio.h>
#include<stdlib.h>
void main()
{
int num;

// Variable marks is of Char Type
char marks[3] = "98";

printf("Please Enter Marks : ");
scanf("%s",marks);

num = atoi(marks);

printf("nMarks : %d",num);
}

Output :
Please Enter Marks : 76
Marks : 76

No comments: