plz answer.. a program that takes a string e.g. "345" and
returns integer 345

Answer Posted / swapnil chhajer

#include<stdio.h>
#include<stdlib.h>

int main()
{
char str[10];
printf("Enter the string : ");
gets(str);
printf("Converted integer : %d",atoi(str));
getchar();
}

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pointer to pointer in c language?

596


What is the advantage of c?

612


Disadvantages of C language.

663


What is the purpose of sprintf?

624


Is fortran still used in 2018?

596






I just typed in this program, and it is acting strangely. Can you see anything wrong with it?

563


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

1574


What do you mean by dynamic memory allocation in c?

652


Why do we need arrays in c?

587


What is a memory leak? How to avoid it?

578


What do you mean by dynamic memory allocation in c? What functions are used?

657


Multiply an Integer Number by 2 Without Using Multiplication Operator

324


How do you define a function?

584


write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...

1489


ATM machine and railway reservation class/object diagram

4806