Question Set

1. The itoa function can convert an integer in decimal, octal or hexadecimal form to a string.



Ask Your Doubts Here

Type in
(Press Ctrl+g to toggle between English and the chosen language)

Comments

  • By: guest on 01 Jun 2017 06.02 pm
    itoa() takes the integer input value input and converts it to a number in base radix. The resulting number a sequence of base-radix digits. Example: /* itoa() example */ #include <stdio.h> #include <stdlib.h> int main () { int no; char buff [50]; printf ("Enter number: "); scanf ("%d",&no); itoa (no,buff,10); printf ("Decimal: %s\n",buff); itoa (no,buff,2); printf ("Binary: %s\n",buff); itoa (no,buff,16); printf ("Hexadecimal: %s\n",buff); return 0; } Output:
    Enter a number: 1250
    Decimal: 1250
    Binary: 10011100010
    Hexadecimal: 4e2
Show Similar Question And Answers
QA->If function inside another function is called a _____ Function....
QA->What is the highest digit that can appear in an Octal number system?....
QA->P can do a work in the same time in which Q and R together can do it. If P and Q work together, the work can be completed in 10 days. R alone needs 50 days to complete the same work. then Q alone can do it in....
QA->Energy stored in a compressed string is?....
QA->Energy of one form can be changed to another form. The process is called?....
MCQ->The itoa function can convert an integer in decimal, octal or hexadecimal form to a string.....
MCQ->Which of the following snippets are the correct way to convert a Single into a String? Single f = 9.8f; String s; s = (String) (f); Single f = 9.8f; String s; s = Convert.ToString(f); Single f = 9.8f; String s; s = f.ToString(); Single f = 9.8f; String s; s = Clnt(f); Single f = 9.8f; String s; s = CString(f);....
MCQ->Which of the following is correct way to convert a String to an int? String s = "123"; int i; i = (int)s; String s = "123"; int i; i = int.Parse(s); String s = "123"; int i; i = Int32.Parse(s); String s = "123"; int i; i = Convert.ToInt32(s); String s = "123"; int i; i = CInt(s);....
MCQ->Which of the following statements are correct about the String Class in C#.NET? Two strings can be concatenated by using an expression of the form s3 = s1 + s2; String is a primitive in C#.NET. A string built using StringBuilder Class is Mutable. A string built using String Class is Immutable. Two strings can be concatenated by using an expression of the form s3 = s1&s2;....
MCQ->What will be the output of the program? public class WrapTest { public static void main(String [] args) { int result = 0; short s = 42; Long x = new Long("42"); Long y = new Long(42); Short z = new Short("42"); Short x2 = new Short(s); Integer y2 = new Integer("42"); Integer z2 = new Integer(42); if (x == y) / Line 13 / result = 1; if (x.equals(y) ) / Line 15 / result = result + 10; if (x.equals(z) ) / Line 17 / result = result + 100; if (x.equals(x2) ) / Line 19 / result = result + 1000; if (x.equals(z2) ) / Line 21 / result = result + 10000; System.out.println("result = " + result); } }....
Terms And Service:We do not guarantee the accuracy of available data ..We Provide Information On Public Data.. Please consult an expert before using this data for commercial or personal use | Powered By:Omega Web Solutions
© 2002-2017 Omega Education PVT LTD...Privacy | Terms And Conditions
Question ANSWER With Solution