139 Topics
|
|
This function I did to improve calculator program by eliminating problems with Pythons problem of dividing integer with integer and giving integer division result. |
|
Hi, ok the problem is that when a button is click I want it to add 1 (+1) to a textbox. This process will keep on going on till I tell it not to...How would I just keep a running total of whats happening in the textbox...What I mean to … |
|
Hey, I have to write a program using vectors that will input a list of positive integers terminated by a negative integer and output the unique numbers in the list in ascending order? Can anyone help me get started? |
|
Hi all, I have to write a program that will input a string and convert the string to an integer value. The program should then output the integer value multiplied by 2. Also im not supposed to use any built in functions.Can anyone help me? Thanks a million! Sana Zafar |
|
[CODE] import java.util.*; import java.util.Scanner; public class InputconsoleArray2 { public static void main(String args[]) throws java.io.IOException { int[] a=new int[100]; // create an array of type interger size // Objects of type Scanner are useful for breaking down formatted input into tokens and // translating individual tokens according to their … |
|
Hello guys, this is my first time in these forums, so I apologize for my bad English. Well, here's the problem: I need to get the frequency of integer numbers that are stored in a file, their range is from 0 to 100, their amount is unknown and depends on … |
|
I have this code: [CODE] public static int pow (int x, int n) { if (n==0) return 1; int t = pow (x, n/2); if (n%2 == 0) { return t*t; } else { return t*t*x; } } public static void main(String[] args) { System.out.println (pow (5, 2)); } [/CODE] … |
|
I was trying out a 2-dimensional integer array on a UNIX box. I hit up a 'Segmentation Fault' on trying to run it. [CODE]#include <iostream> #include <cstdlib> using namespace std; int main() { int matrix[2000][2000]; int i, j; srand ( 1 ); for (i=0; i<2000; i++) { for (j=0; j<2000; … |
|
Hello everyone. I'm developing a program where I need to write some data on a FIFO file, and I'm using the command Write() for that. My problem, is that with that command I can't send integers, so I was thinking about Convert them to Char, and then increment them on … |
|
Ever wondered how to calculate the date of easter? Well here is how to do it in C# |
|
the code takes each character and stores where and how many times a roman numeral appears and the assess the integer. this is my first code im posting. anything to make the code better is most welcome. roman numeral refers to M=1000 D=500 C=100 L=50 X=10 V=5 I=1 and uses … |
|
[CODE=c] #include<stdio.h> #include<math.h> main() { int i=0,j,c,s[100]; double t=0; while((c=getchar())!='\n') { s[i]=c; ++i; } for(j=i;j>0;--j) { t=t+(s[i-1]*(pow(16,(4-((double)i))))); --i; } printf("%d",(int)t); return 0; } [/CODE] HI, i need to write a program that converts an hexadecimal number into integer form (for convenience i'm only considering hexadecimal no. without alphabets from a … |
|
This is a [inlinecode]strtol[/inlinecode] version of [url=http://www.daniweb.com/code/snippet353.html] Read an Integer from the User, Part 2[/url]. |
|
Hello. I need to write a static recursive method that returns the frequency of occurrence a particular digit d in an integer n. For example, if passed (1342457,4) it should return 2, whereas when passed (1342457,6) it should return 0. I won't put my code in as it is arbitrary, … |
|
i have a list of size 3 in my controller i say int noofcards=List1.size(); which returns me the value 3 i want to print this value in my jsp. How do i do it ? i tried this way Controller [code=java]request.setAttribute("noofcards",noofcards);[/code] jsp [code=JSP]<%= request.getAttribute("noofcards"); %>[/code] Thanks in Advance |
|
Here's a function that manually converts an integer to any base between 2 and 36, the parameter list is: [CODE]void toBase( int value, // Integer value to convert char *target, // Pointer to a large enough buffer int base, // Base (from 2 to 36) int fixedDigitCount // The minimum … |
|
Hello all. I have a small problem, i need to recieve a 8 digit number for example: 12345678 87654321 and so on. After i need to devide the value and use the int as a array, something like int i=123; System.out.println(i[1]); It should return 2 (therocially), but obviously the doesnt … |
|
Hello! I'm kind of new in assembly programming and I've been struggling with the following problem today: How to print an integer, using BIOS interrupt [B]10h[/B], with its [B]0Eh[/B] in AH register, as its function to print a character to the screen... For example, how to print the last digit … |
|
Hi guys, Could someone help me on this, the problem is: Using array, Ask for 10 integer inputs then display the frequency distribution of the inputs. say, [B]Example Output:[/B] Enter input 1: 2 Enter input 2: 2 Enter input 3: 3 Enter input 4: 4 Enter input 5: 5 Enter … |
The End.