142 Topics

Member Avatar for
Member Avatar for Emma_3

I need to find a digit at a specific postion in a number. Example number 652796, user inputs a 4, "2" is displayed. I have the basis for it, but most of the time, the output is incorrect. Not sure what's wrong. #include <iostream> #include <cmath> using std::cout; using std::cin; …

Member Avatar for vmanes
0
1K
Member Avatar for jj.dcruz

I have coded this today and wanted to find all the data inside my database which is start_time and end_time also date which is very easy for me to validate but when it comes to time... its really hard this is what I want to do. 1. check all the …

Member Avatar for jj.dcruz
0
189
Member Avatar for bEedzay

number1 = 0; number2 = 0; while(number1 < 5) number1 ++; number2 += number1; Question#1 : what is the value of number1 when the loop exits? Question#2 : what is the value of number2 when the loop exits? Question#3 : if the statement number1++ is changed to ++number1, what is …

Member Avatar for AndrisP
0
203
Member Avatar for Christoffer_S

Hello, I'm using the DX Studio engine (used to develop 3d games/applications), which uses javaScript as the main language. Since the engine is not getting much attention, their forum is almost completely dead. So I thought maybe one of you here at daniWeb could help me out? When previewing my …

Member Avatar for Christoffer_S
0
250
Member Avatar for Kewne

I have a query that used union all.. and produces a table like this: `+-------------+------------------------+-----------+--------------+ | Type | Name | IDNum | Warnings | +-------------+------------------------+-----------+--------------+ | M | sample | 2013-1 | 4 | | L | sample | 2013-1 | 2 | +-------------+------------------------+-----------+--------------+` now i made a while loop …

Member Avatar for pritaeas
0
1K
Member Avatar for ali.mokhtari.560

Hi every body.i want to make a factorial program with do while loop in the easiest way without using 'for' loop but i cant do that.please help me out!

Member Avatar for Ancient Dragon
0
110
Member Avatar for arifkutty

<?php $dbc=mysqli_connect('localhost','root','','sam_telephone'); $query="SELECT * FROM master_name"; $result= mysqli_query($dbc,$query); $display=mysqli_fetch_array($result); echo $display['f_name']; /// its show me the result which is fine // but when i apply while loop it does not show any thing. while($y = mysqli_fetch_array($result)){ echo $y['f_name']; } // $y['f_name'] should give me a result becuase it showing me …

Member Avatar for arifkutty
0
205
Member Avatar for tibor.marias

Evening Sirs, I got some problems in PHP when using while loop in tables. My problem is that I can't make the rows be the same width. This is my preview: ![11ce93daec6265124e189def81dc9696](/attachments/large/4/11ce93daec6265124e189def81dc9696.png "11ce93daec6265124e189def81dc9696") I want the blue part of the table, to be equal width with every relative white part. …

Member Avatar for tibor.marias
0
581
Member Avatar for everton.retweets

Hi Everyone... I have been digging around the web for the last two days trying to fix this problem myself, but have come to the realization that I need some help. I have a mysql query that selects all country names from my country db, (works as described) I then …

Member Avatar for phorce
0
732
Member Avatar for jshlmnc

I am having trouble getting started with my program. I have writen the array but I am having trouble starting the if statemnent to fill the seats in the program. If they press 1 it needs to fill seats 1 through 5 if they press 2 it needs to fill …

Member Avatar for JamesCherrill
0
308
Member Avatar for Pobunjenik

Hi everyone! So, I hereby hope to show that I've made progress in coding java (largely due to the help of this great community). I want to thank everyone for dealing with me (especially James). :) The goal: The code below is supposed to seed a layout of boats into …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Kareem Klas

Hi everyone I'm studying the part about while-statement but I don't understand the explanation in the book really well and the example doesn't work for me so I can't see it with my own eyes how it works. Can someone explain what the while-statement means and does? Also can you …

Member Avatar for Kareem Klas
0
330
Member Avatar for rahul pareek

hello everyone i am getting problem while configuring ntp server in rhel6 when i write nptq -p output:- no association id's returned what should i do

Member Avatar for CimmerianX
0
157
Member Avatar for Aethir

# This is an advanced guess the number game. import random # The very basis of this game. import math # Used for math.ceil import time # Used to split up long portions of text. def errorDisplay(errorCode): if errorCode == '1': print('\n\n\nError ' + errorCode + ': unlockedGameModes outside of …

Member Avatar for Aethir
0
277
Member Avatar for robert.speciale

I have a void function that takes data from an ifstream, reads the first value, (which is an ID #), and compares that value against the ID# info from an array of records. If it's invalid, the rest of the line is ignored. If it's valid, it adds the hours …

Member Avatar for robert.speciale
0
235
Member Avatar for gobiking

Hello, I am new to C++ and I was trying to write a simple calculator program that has a do-while loop and also includes a series of != statements. Even though I make the statements with all the appropriate keystrokes it keeps giving me my invalid sign statement. Also, I …

Member Avatar for Labdabeta
0
288
Member Avatar for ivanichi

i have problem about while loop. this my code, error_reporting(E_ALL ^ (E_NOTICE | E_WARNING)); function multiexplode ($delimiters,$string) { $ready = str_replace($delimiters, $delimiters[0], $string); $launch = explode($delimiters[0], $ready); return $launch; } function my_replace($srch, $replace, $subject, $skip=1){ $subject = explode($srch, $subject.' ', $skip+1); $subject[$skip] = str_replace($srch, $replace, $subject[$skip]); while (($tmp = array_pop($subject)) …

Member Avatar for ivanichi
0
565
Member Avatar for wolfgangcs

Is there a reason why this won't take aciton or submit. I don't get any movement on the browser. Neither of the forms move. <div data-role="content"> <?php echo "<table width=\"500\" border=\"1\" cellpadding=\"4\">"; while($row = mysql_fetch_array($showEmployees)) { echo " <div data-role=\"collapsible\" data-mini=\"true\" data-content-theme=\"c\"> <h3>{$row['employee']}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$row['phone']}</h3> <p> <form action='admin.php' method='post' accept-charset='UTF-8' id='editemployee' > …

Member Avatar for masterjiraya
0
592
Member Avatar for yap.junjie.7

Help me look at the codes below. It has T_IF error and T_WHILE error. The errors are on line 7 and line 18. I hope anyone can teach me to repair it and the code function is still same. <?php require_once("db.php"); session_start() if (!isset($_SESSION['cart'])) { <---T_IF error $_SESSION['cart'] = array(); …

Member Avatar for TonyG_cyprus
0
392
Member Avatar for fsefsef23

I'm making a calculator that performs operations sequentially (from left to right, not precedence), using ASP.NET/C#, but I'm having trouble trying to get the loops going through the input box string in my code behind. Obviously to me the logic seems to make sense, but for some reason, I get …

Member Avatar for ddanbe
0
315
Member Avatar for CreatorZeus

My while keeps looping and i dont know why: code <?php $result = mysql_query("SELECT * FROM tag WHERE point='$pagename'"); while($row = mysql_fetch_array($result)) { $result = mysql_query("SELECT * FROM tag WHERE point='$pagename'"); //username echo $row["user"] . " ||"; //alias check $result = mysql_query("SELECT * FROM tag WHERE (user='$my_name' && point='$pagename')"); if …

Member Avatar for IIM
0
188
Member Avatar for kadowling

I'm wanting to create a while loop that asks the user if he wants to run the program or not... very basic... I know. I was wanting the prompt to ask the user to input "Y" or "y" to have the program run. Like this: programStart = str(input("Please press 'y' …

Member Avatar for vegaseat
0
239
Member Avatar for eric.i.perez

1.Make and run a program that will output all the prime numbers from 1-100. (FN do prime) 2.make and run a program that will allow the user to input 10 numbers and display the total number of positive and negative numbers entered. 3. write a program that reads numbers until …

Member Avatar for NathanOliver
0
140
Member Avatar for Doogledude123

Im incrementing a value in a while loop, but its only incrementing when my mouse is moving. Any ideas? while (isAlwaysTrue) { value += 1; } Thats basically what Im doing.

Member Avatar for Doogledude123
0
1K
Member Avatar for java123456

hey guys , I don't understand why the outPUT is that for the code below.. can someone please explin me how it works. Thank you. class example{ public static void main (String[]args){ int i = 1,j; while (i<=3){ j=i; while(j<=4){ System.out.println(j+" "+i); j=j+2; } i=i+1; } } } HERE IS …

Member Avatar for maurice91
0
161
Member Avatar for joshmac

I am getting the error message "Invalid argument supplied for foreach()". I can't see to figure out what. Below is my query. Is there something I'm missing? Thanks public function editRole($id) { $q = $this->_db->query("SELECT * FROM `" . TP . "roles` WHERE `ID` = '" . floatval($id) . "' …

Member Avatar for pritaeas
0
198
Member Avatar for tibor.marias

Dear Sirs! I would like to echo out the last iteration of a while loop differently as the first ones. This is my code wich echos out the first and the last iteration, but I need the middle iterations as wel.. <?php // Print if ($row = mysql_fetch_array($result)) { echo …

Member Avatar for diafol
0
149
Member Avatar for Delightfully

def exponents(num1,num2): if (num2==0): return 1 else: return num1*exponents(num1,num2-1) Hey I was wondering how I can generate a list of exponents using a for loop or a while loop so that the numbers display like this: Input (2,3) Output 2,4,8 What I have so far only returns the answer, Please …

Member Avatar for TrustyTony
0
2K
Member Avatar for IAMADOG

I was looking at some sample code [here](http://www.kernel.org/doc/man-pages/online/pages/man2/mmap.2.html) and it had this for error handling: #define handle_error(msg) \ do { perror(msg); exit(EXIT_FAILURE); } while (0) If I remember correctly do {} while (0) would execute only once, so what is the point of this?

Member Avatar for deceptikon
0
125
Member Avatar for trd360

My assignment is to randomly generate a password based on the selection chosen by the user. So far, my code is unfinished but that's because I've run into a problem. For the second selection(Lowercase and uppercase letters). My password will display lowercase and uppercase letters but it won't be enough …

Member Avatar for subramanya.vl
0
164

The End.