Questions

Q:

What do the functions atoi(), itoa() and gcvt () do? Show how would you use them in a program.

Answer

atoi()         Converts a string to an integer.


itoa()         Convert an integer to a string


gcvt()        Converts a floating-point number to a string


 


#include "stdlib.h"


main()


{


      char s[] = "12345";


      char buffer [15], string[20];


      int i;


      


      i = atoi (s);


      printf("\n%d",i);


 


       gcvt (20.141672, 4, buffer);


       printf ("\n%s", buffer);


 


       itoa(15, string,2);


        printf ("\n%s", string);


}

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

2 6645
Q:

We remember Charles Babbage (1792-1871) for what ?

A) Computers B) Radio-Telegraphy
C) Steam Boating D) Telescopes
 
Answer & Explanation Answer: A) Computers

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Inventions

9 6644
Q:

Which of the following features may occur when lava cool at the surface

A) Basalt plateau B) Still
C) Batholith D) Dyke
 
Answer & Explanation Answer: A) Basalt plateau

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: World Geography

5 6642
Q:

Which type of entity is related to two or more associated entities that each contain specialized attributes that apply to some but not all of the instances of the entity?

A) Supertype entity B) Subtype entity
C) Archetype entity D) Instance entity
 
Answer & Explanation Answer: A) Supertype entity

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Database

2 6641
Q:

Light year is a unit of

A) time B) speed of light
C) distance D) mass
 
Answer & Explanation Answer: C) distance

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Physics

10 6638
Q:

Smallest of all the continents?

A) Asia B) Australia
C) Africa D) America
 
Answer & Explanation Answer: B) Australia

Explanation:

Australia is the smallest of all the continents

Report Error

View Answer Report Error Discuss

31 6633
Q:

The fastest growing plant is ______ ?

A) Ashoka B) Banyan
C) Eucalyptus D) Rose
 
Answer & Explanation Answer: C) Eucalyptus

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: General Science
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

32 6631
Q:

Kurukshetra , the sence of the epic battle between Kauravas and pandavas, is situated in 

A) Gujarat B) Punjab
C) Uttar Pradesh D) Haryana
 
Answer & Explanation Answer: D) Haryana

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Indian History

97 6630