`{"id":"048b867c-7f6e-4bb4-9dc3-d2a1a53c09fa","name":"Digits Of A Number","description":"1. You've to display the digits of a number.\r\n2. Take as input \"n\", the number for which digits have to be displayed.\r\n3. Print the digits of the number line-wise.","inputFormat":"\"n\" where n is any integer.","outputFormat":"d1\r\nd2\r\nd3\r\n... digits of the number","constraints":"1 &lt;= n &lt; 10^9","sampleCode":{"cpp":{"code":"#include <iostream>\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv){\r\n int n;\r\n cin >> n;\r\n\r\n //write your code here\r\n \r\n}"},"java":{"code":"import java.util.*;\r\n \r\n public class Main{\r\n \r\n public static void main(String[] args) {\r\n // write your code here \r\n }\r\n }"},"python":{"code":"def digits(n):\n # write your code here\n\ndef main():\n n = int(input())\n digits(n)\n\nif __name__==\"__main__\":\n main()"}},"points":10,"difficulty":"easy","sampleInput":"65784383","sampleOutput":"6\r\n5\r\n7\r\n8\r\n4\r\n3\r\n8\r\n3","questionVideo":"https://www.youtube.com/embed/wq-Cp3kl1nI","hints":[],"associated":[{"id":"58f63cfc-8fb9-4952-978c-b07a36df674a","name":"int div = (int)Math.pow(10, 3); What does the (int) before Math.pow() mean?","slug":"int-div-int-math-pow-10-3-what-does-the-int-before-math-pow-mean","type":4},{"id":"a0d45a78-9b36-484f-8332-071fd2674fac","name":"Which of the following statements print the integer stored","slug":"which-of-the-following-statements-print-the-integer-stored","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"72157774-7fd0-4b8e-88dc-037800acd626","name":"Getting Started","slug":"getting-started-9996","type":0},{"id":"be985039-e2e4-4ba7-9e4a-3cf21b0ee06b","name":"Digits Of A Number","slug":"digits-of-a-number","type":1}],"next":{"id":"05c8c176-61f1-486f-a86f-22a3ef2e0c13","name":"Digits of a Number","type":3,"slug":"digits-of-a-number"},"prev":{"id":"52d875fc-90c1-4488-bb06-c140452f7619","name":"Count Digits In A Number","type":3,"slug":"count-digits-in-a-number"}}}`

# Digits Of A Number

1. You've to display the digits of a number. 2. Take as input "n", the number for which digits have to be displayed. 3. Print the digits of the number line-wise.

`{"id":"048b867c-7f6e-4bb4-9dc3-d2a1a53c09fa","name":"Digits Of A Number","description":"1. You've to display the digits of a number.\r\n2. Take as input \"n\", the number for which digits have to be displayed.\r\n3. Print the digits of the number line-wise.","inputFormat":"\"n\" where n is any integer.","outputFormat":"d1\r\nd2\r\nd3\r\n... digits of the number","constraints":"1 &lt;= n &lt; 10^9","sampleCode":{"cpp":{"code":"#include <iostream>\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv){\r\n int n;\r\n cin >> n;\r\n\r\n //write your code here\r\n \r\n}"},"java":{"code":"import java.util.*;\r\n \r\n public class Main{\r\n \r\n public static void main(String[] args) {\r\n // write your code here \r\n }\r\n }"},"python":{"code":"def digits(n):\n # write your code here\n\ndef main():\n n = int(input())\n digits(n)\n\nif __name__==\"__main__\":\n main()"}},"points":10,"difficulty":"easy","sampleInput":"65784383","sampleOutput":"6\r\n5\r\n7\r\n8\r\n4\r\n3\r\n8\r\n3","questionVideo":"https://www.youtube.com/embed/wq-Cp3kl1nI","hints":[],"associated":[{"id":"58f63cfc-8fb9-4952-978c-b07a36df674a","name":"int div = (int)Math.pow(10, 3); What does the (int) before Math.pow() mean?","slug":"int-div-int-math-pow-10-3-what-does-the-int-before-math-pow-mean","type":4},{"id":"a0d45a78-9b36-484f-8332-071fd2674fac","name":"Which of the following statements print the integer stored","slug":"which-of-the-following-statements-print-the-integer-stored","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"72157774-7fd0-4b8e-88dc-037800acd626","name":"Getting Started","slug":"getting-started-9996","type":0},{"id":"be985039-e2e4-4ba7-9e4a-3cf21b0ee06b","name":"Digits Of A Number","slug":"digits-of-a-number","type":1}],"next":{"id":"05c8c176-61f1-486f-a86f-22a3ef2e0c13","name":"Digits of a Number","type":3,"slug":"digits-of-a-number"},"prev":{"id":"52d875fc-90c1-4488-bb06-c140452f7619","name":"Count Digits In A Number","type":3,"slug":"count-digits-in-a-number"}}}`

Editor

# Digits Of A Number

easy

1. You've to display the digits of a number. 2. Take as input "n", the number for which digits have to be displayed. 3. Print the digits of the number line-wise.

1 <= n < 10^9

## Format

### Input

"n" where n is any integer.

### Output

d1 d2 d3 ... digits of the number

## Example

Sample Input

`.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}65784383`

### Sample Output

```.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}6 5 7 8 4 3 8 3```

Question Video

Discussions

Show Discussion

Related Resources