# sum of factorials of digits

I want to find 3digit number that the sum of the factorials of it’s digits is the same as that number. what is the problem in my codes since nothing shows. Thank u so much. Test function gives each digit and fact funtion compute the factorial. #include <iostream> using namespace std; int fact(int y); int… Read More sum of factorials of digits

# Breaking down a number into digits – C

I’m trying to create a program that breaks down a number into its component digits. The code I’ve written so far is as follows: #include <stdio.h> int main() { int num; int digits; int count = 1; printf("Insert a positive number: "); do { scanf("%d", &num); } while (num <= 0); printf("In digits… \n"); //… Read More Breaking down a number into digits – C

# Split 7 digit into separate columns in csv with python

Hi I have 100 data in csv file I want to split 7 digit number into seprate columns with python My csv file is like this: A 1234567 Split into new columns: B C D E F G H 1 2 3 4 5 6 7 I try Splitdigit= df[‘A’]>str.split(expand=true).add_perfix(‘A’) >Solution : If you have… Read More Split 7 digit into separate columns in csv with python

# How am I supposed to loop repeatedly over a "function" in Java?

I have written a code which takes in a number and multiplies it’s digits together and here it is. public class Happy { public static int findSum(int k) { int sum = 0; while (k != 0) { sum = sum + ((k % 10)*(k % 10)); k = k/10; } return sum; } public… Read More How am I supposed to loop repeatedly over a "function" in Java?

# Calculate number of digits of a decimal number in c

how am I supposed to find the number of digits of decimal numbers in c? ex. find how many digits are in 123.4567?! >Solution : how am I supposed to find the number of digits of decimal numbers in c? ex. find how many digits are in 123.4567? Start by converting it to a string.… Read More Calculate number of digits of a decimal number in c

# check if all the digits of the given number are different

I want to create a 4-digit number between 1000 and 10000 with different digits, but I am a bit inexperienced as I am new to this stuff. Can you help me? import random number = random.choice(range(1000,10000)) print(number) >Solution : import random a = 0 while a == 0: a, b, c, d = random.sample(range(10), 4)… Read More check if all the digits of the given number are different

# cannot cast to jsonb if non-negative numeric vlaue have plus sign

the following command working select ‘[0,1, -2, -0.3444, 5.6]’::jsonb; However the following 3 not working. select ‘[0,1, -2, (+0.3444), 5.6]’::jsonb; select ‘[0,1, -2, +0.3444, 5.6]’::jsonb; select ‘[0,1, -2, +0, 5.6]’::jsonb; The following working. select +0.1; select (+0.1)::text; >Solution : The first working example is a string containing a valid JSON document being cast as JSONB;… Read More cannot cast to jsonb if non-negative numeric vlaue have plus sign