52 Solved Topics

Remove Filter
Member Avatar for
Member Avatar for mathgirlgrade6

Hi, So how exactly do we take the length of an int array? Lets say that there is an array called int nums []={2, 1, 2, 3, 4}; Is there a function that can be used to find it?

Member Avatar for Donald_6
0
19K
Member Avatar for Niloofar24

Hello. I have a list: mylist = [2,4,4] How can i take number 244 out from the list? Something like: number = 244 Here 244 is integer.

Member Avatar for vegaseat
0
283
Member Avatar for samuel terngu

My UPDATE vb.net code below displays this error message:conversion from string "UPDATE tblstaff SET fName='name' " to type 'integer' is not valid.Microsoft.visualBasic conn.Open() If conn.State = ConnectionState.Open Then com = New OleDb.OleDbCommand("SELECT *FROM tblstaff ") com.Connection = conn Dim cb As New OleDb.OleDbCommandBuilder(da) da.Fill(ds, "Eeestaffinfo") Dim sql As String = …

Member Avatar for samuel terngu
0
808
Member Avatar for Lamirp

Ok I'm just looking for a cleaner way to achieve my goal here, if there is one and if this is not much of a satisfactory method. The goal is to accept an integer from a user using JOptionPane.showInputDialog. A brief example of what I'm currently doing do { check …

Member Avatar for mKorbel
0
6K
Member Avatar for CoilFyzx

Hello Good day. Here is the problem I am trying to solve. I have a table as seen below. ![232465554203149acd8363d3a4a127ae](/attachments/large/3/232465554203149acd8363d3a4a127ae.jpg "232465554203149acd8363d3a4a127ae") My GOAL: Columns A through G are going to be filled with integers. (I have already created an integer model so that these cells only take integers). As the …

Member Avatar for CoilFyzx
0
445
Member Avatar for Taras20

Hi everyone, I need to use integer that is typed into textbox to do some math functions. here is what i have: Private Sub btnDivide_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click dim x as integer dim y as integer dim tbox as integer tbox = (Textbox1.Text) x …

Member Avatar for TnTinMN
0
548
Member Avatar for mical700

I have problem reading file form command line. I am trying to do " abcd: ./rev < numbers", but it gives me an error: ./rev < numbers Usage : ./rev FILENAME Here is the code: #include <stdio.h> #include <stdlib.h> void reverse(FILE * file) { int fscanf_return_value; char x; /* read …

Member Avatar for mical700
0
363
Member Avatar for phfilly

Hi I have trouble with implementing a dynamic two dimensional pointer array on allocating memory for it. I tried it this way but not sure if it's correct. The array should contain pointers to heap allocated **Integer** objects const int size = 10; Integer *** twoD; twoD = new Integer**(); …

Member Avatar for Ancient Dragon
0
321
Member Avatar for anandschiru

How to add an integer no to a date so tat i can a new date foe ex: date=10/11/2012 no=5 newdate=15/10/2012 **Any body plz help to solve the problem**

Member Avatar for anandschiru
0
288
Member Avatar for efth

Let's say I have a method called 'test' which should return the arraylist called 'theList' containing X number of Integers. How would I do that? public static void test(){ SOME CODE ... return theList } What should 'void' and 'theList' be replaced with in that code to make it work?

Member Avatar for efth
0
307
Member Avatar for babi.meloo

I need to design an application that determines and prints the number of odd, even, and zero digits in an integer value read from the keyboard. This is what I have so far. public static void main (String[] args) { int odd=0, even=0, zero=0; Scanner scan = new Scanner(System.in); int …

Member Avatar for NormR1
0
3K
Member Avatar for O_mini

Hello, thanks for taking the time to read this. I'm working on (what should be) a simple, simple java program, I am very new to java so please bear with me. I'm writing code with a method that takes an array of int values and determines if all the numbers …

Member Avatar for Taywin
0
2K
Member Avatar for rfrapp

Hello, I am trying to fill an array with 20 unique random values between 1 and 60. I know what I need to do to get this to work, but I'm not sure how to do it. Here's what I've got: void fillArray( int arr[], int size) { int arr2[20]; …

Member Avatar for RainbowMatrix
0
2K
Member Avatar for boiishuvo

I made a simple program - conservative sequence integers with a sum, for example input: 15, the output should be 1, 2, 3, 4, 5 I made this program in c++ and it worked successfully, see below: #include <iostream> #include <string> using namespace std; int main() { int num, i, …

Member Avatar for Taywin
0
249
Member Avatar for pooja.shinde

System date & time is in SimpleDate format. How can i convert this into integer? **"sdf.format(new Date(System.currentTimeMillis()))"...**.......... I want to convert current time** into integer** data type. *Plz plz plz help me.* Any help for this is alwayz welcome.

Member Avatar for pooja.shinde
0
225
Member Avatar for MichaelCJ10

I want to create a code that will allow me to calculate bonuses based on the 10 salarys. i need if statements for this, i need to then assign the new value to my other array i have set up called total, and then i need to display that as …

Member Avatar for zeroliken
0
316
Member Avatar for singularity~

I have an integer called: int pID = 0; Inside my while loop I'm using pID++; to increment it. Sometimes the pID doesn't get incremented and sometimes it will. My sample output would be. 0 1 2 2 2 3 4 5 5 6 7 Does anyone have an idea …

Member Avatar for singularity~
0
234
Member Avatar for stinkypete

Does anyone have an algorithm that generates all 10-digit integers that have at least one digit repeated? Trawling through all 9000000000 of them and checking them individually is too slow. Thanks.

Member Avatar for VernonDozier
0
894
Member Avatar for inuasha

I want to be able to generate my own random numbers without using the random module. I want to do this that way I can learn somewhat how to do the big boy code on my own.

Member Avatar for snippsat
0
2K
Member Avatar for Labdabeta

I am really confused as to the purpose of the unary + operator. What in the world does it do? I have tested it and it doesn't return the absolute value. Does it just return the operand? And if so what purpose is it?! (I mainly care about integer types)

Member Avatar for mrnutty
0
296
Member Avatar for //Gonz

Hello daniweb chums I once again cannot seems to get a simple bit of text box validation working I am trying to detect if a first name entered contains a number by converting the text box text into a char array and then convert each character entered (using a for …

Member Avatar for Antenka
0
259
Member Avatar for Matth963
Member Avatar for Matth963

[CODE]int numdigits(int num){ int len = 0; while(num >= 10){ num = num/10; len++; } return len; } [/CODE] This algorithm is used to count the number of digits but I can't understand it. Someone explain it to me please :D Thanks

Member Avatar for hfx642
0
101
Member Avatar for Muhammad Anas

Hi, I am trying to write a program that will separate the digits of a non-negative integer and will print them each two spaces a apart but I have to avoid using arrays. For example if input is: 12345 then output should be: 1 2 3 4 5 I have …

Member Avatar for Muhammad Anas
0
3K
Member Avatar for maynardjk13

Greetings! I've been working on this program for the past couple of hours now, and I cant seem to get it right. I'm supposed to write a program that reads in integers from a text file, and then find the sum of the integers. The problem I'm having is with …

Member Avatar for maynardjk13
0
230
Member Avatar for Mike Askew

Hi all, My program is proving Kaprekar's Constant - 6174. To do this I will need to store values exactly how they come out without losing any preceding 0's which int has a habit of cutting off. For example: Number to store exactly: 0147 Int stores: 147 A googling session …

Member Avatar for Mike Askew
0
138
Member Avatar for Curtisq

So my problem is writing a program that asks the user to input a number wich is stored with scanf then print the binary representation of that number in 32 bits, as in if the number is 1 i would need 31 0's and a 1. [CODE]#include <stdio.h> void dec_bin(long …

0
102
Member Avatar for ben1996123

Hello, I just downloaded the [url=https://mattmccutchen.net/bigint/]big integer library[/url], and I want to use it in my prime number checking program. I downloaded the zip file and got a bunch of .cc and .hh files. I need to know what to do with the files, where I should put them, and …

Member Avatar for ben1996123
0
232
Member Avatar for rhuffman8

I am working in an older version of Python (2.6, I believe). I cannot update to the latest version because it is not currently compatible with the other program I need the code to run with so, unfortunately, the "decimal" module is not available to me (as far as I …

Member Avatar for Gribouillis
0
232
Member Avatar for stupendousomega

I have a user input an integer... But if it's really long, it throws an exception and starts looping infinitely. How would I make it cut the number after the first 7 digits and only use that? Like, if I inputted 654897654321648435435135813513843513543514, it would only accept 6548976. Please help.

Member Avatar for mrnutty
0
210

The End.