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

a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

1853


What is the use of define in c?

805


What is pointer & why it is used?

820


What is difference between main and void main?

864


Can a variable be both constant and volatile?

829


How do you do dynamic memory allocation in C applications?

844


What is the use of a ‘’ character?

817


writ a program to compare using strcmp VIVA and viva with its output.

1788


What is nested structure in c?

814


What is multidimensional arrays

865


what are bit fields? What is the use of bit fields in a structure declaration?

1783


How can I make sure that my program is the only one accessing a file?

955


Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?

891


What are conditional operators in C?

827


What is the difference between call by value and call by reference in c?

901