19,876 Topics

Member Avatar for
Member Avatar for RediRedi

Any of you knows a way to solve Power cricis [Click Here](http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem&problem=87) So fare i've found this code but i doesnt help much as it takes N as input(13<N<100) and return an M so that the last one standing is the 13th city. int main() { int N, M; struct …

0
79
Member Avatar for okundi

a company pays employees gratuity on retirement that can be computed using the formular: grayuity= (salary x fixed rate x number of years worked) + one month salary. formulate an algorith that can be used to calculate the gratuity and write a c++ program that can be used for the …

Member Avatar for pritaeas
0
58
Member Avatar for general2012

hi, after a long time been posting in this forum.I am trying to manipulate newtons divide difference formula ,actually like this [see it here](http://www.dailyfreecode.com/code/newtons-divided-difference-method-2381.aspx) **but in a different manner** .but my code is not working.i am getting disgusting values in my table.can any one please check the errors and tell …

0
95
Member Avatar for gobiking

Hello, I am trying to start implementing functions from a class into my Calculator just to get used to the idea of it. when I tried calling for my min max functions into my calculations function it is spitting out an error arguement of type "float" is not compatable with …

Member Avatar for gobiking
0
1K
Member Avatar for shark101

hey guys I need help with this I have no idea how to work this out please help me with like atleast the starting coding i am trying to google too but i cannot find any info on this. ***"char * copyString( const char * s ); copyString returns a …

Member Avatar for raptr_dflo
0
279
Member Avatar for Landoro

Hey guys! It's been a long time since I visited daniweb,but I need some help understanding something.A friend of mine gave me problem to solve, but the assignment is strange,I can't seem to find the actually meaning of what I need to generate as an answer.Here goes: By a given …

Member Avatar for raptr_dflo
0
282
Member Avatar for alice.ng.3344

I am doing code for CAESAR CIPHER. I need to built a histogram or frequency distribution for the output. I thought that finding out the frequency of the ASCII code, then print the frequency with * by using loop. But my code din't have array, can't do ++freq[c[i]]. I have …

Member Avatar for DeanMSands3
0
350
Member Avatar for Cwww

Hello, i have create a human tree, the only remains is to get the codes in Huffman tree (0-Left, 1-Right) How i can traverse the tree and for every letter-weight in tree to get the path of 0101 How my code works ***1st Part - Nodes Initialisation*** - Create Tree …

Member Avatar for Cwww
0
278
Member Avatar for str91

hello friends i wanna know is this algorithm for Travelling salesman problem (TSP) correct ? if isn't help me for correct algorithm plz ? tnx int tsp(int **adjMatrix, int numberPoints) { for (int i = 0; i < numberPoints; i++) for (int j = 0; j < numberPoints; j++) for …

Member Avatar for rubberman
0
124
Member Avatar for silentdragoon

Can someone point me towards a dead basic, complete example of a hash table utilising chaining? I've got a working hash function, I am just getting really frustrated with not understanding what I don't understand with the setting up of the hash table. All the examples on the web I've …

Member Avatar for arshdeepkaur
0
674
Member Avatar for jony_munsi

I want to a C# console application code... My problem is... i want take input from keybord a ID like 10510023.. and the 1st 2 digit of this code indicate the year of a student like if ID is 10510023 the year is 2010 or if it is 13510023 the …

Member Avatar for tinstaafl
0
150
Member Avatar for cdea06

So I just started a "C" class and I've done my first few assignments but I feel like I'm over complicating the codes by using to many if else statements. Here's the assignment and my code. Please let me know what you think: [B]Write a program that asks the user …

Member Avatar for rubberman
0
301
Member Avatar for sourabhyogi

Hi, I am trying to write a program which read a certain input in a particular format and then gives an ouput. I wrote a code to read the file. Input is something like this. X 20 60 80 90 X 78 98 97 96 X 34 35 43 23 …

Member Avatar for sourabhyogi
0
269
Member Avatar for nitish.mohiputlall

FUNCTIONS the question is as follows: write a function, ComputeAmount, that takes as input the quantity of an item and the item unit price, and returns the net amount to be paid by customer. my program is working correctly please advise me what i did wrong here are the codes: …

Member Avatar for rubberman
-1
150
Member Avatar for ferizhandi

i want to write a sever application.my sever have some service to client. some of the answer of my server is long(transfer file) and some of them is short(list of online client). when server transferring file to a client , other client request to get online client list. i want …

Member Avatar for rubberman
0
208
Member Avatar for broccoli

Hello everyone. I have to connect to a running server on another host [COMPLETED]. Then, I have to perform a webchat with any chosen single client in the server and I have some questions about that. I am able to connect to any chosen client in the server, I am …

Member Avatar for iamthwee
0
189
Member Avatar for nitish.mohiputlall

write a program that prompts the user to input a positive integer , if the user enters zero or a negative value for nu, it prompts user to input num again and repets this process untill unser inputs a correct value. it then display the sum of the numbers 1 …

Member Avatar for ddanbe
-1
230
Member Avatar for nitish.mohiputlall
Member Avatar for Bchandaria
-2
107
Member Avatar for blackcathacker

Yeah, basically I'm asking if anyone could either walk me through a solution of a problem, or if it would be easier to simply do it themselves. I'm "taking" a C class, and would love it if I could get pointed in the right direction with a certain problem. All …

Member Avatar for ddanbe
0
507
Member Avatar for nitish.mohiputlall

(i)Write a function in C Programming Language, isEven(), that takes an integer value as argument and returns 1 if the latter is even, otherwise returns 0 (zero). (ii)The function isEven() is saved to the file 'usefulfunctions.h'. You are required to write a C program that allows the user to enter …

Member Avatar for Ancient Dragon
-1
195
Member Avatar for Tsaou

Hello everyone... I've searched a lot for this but i can't really figure this out. My project consists of 5 .c files and 4 .h headers. all in the same folder. I compile them separately succesfully but when it comes to group compiling (gcc -o progname and all the code …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for Raghuvamshi

Quick sort is a faster way to sort a given array by recursion The algorithm goes like this: it first takes some index element and seperates all elements lesser than this with larger numbers then places this element in right place and does the same thing with all other

Member Avatar for hhhadvani00
0
903
Member Avatar for SerenityG

Hello, I need help with a program that reads in a string, detailing the occurrence of each variable. So far the program reads a string and shows the number of times each variable occurs (letters only). The program is based of keyboard input, so I was wondering if anyone could …

Member Avatar for Ancient Dragon
0
230
Member Avatar for Iamateur

What will be printed as the result of the operation below: #define swap(a,b) a=a+b;b=a-b;a=a-b; void main() { int x=5,y=10; swap(x,y); printf("%d%d",x,y); }

Member Avatar for Helper guy
0
126
Member Avatar for yassink

Write a function (seat_type) that reads an input from the user that represents a seat class. The user should enter F: for a first class seat, C: for a business class seat, or Y: for an economy seat. The function should validate the user input to accept only F, C, …

Member Avatar for RonalBertogi
0
321
Member Avatar for selipar.jepun.712

Write a C++ program to compute and display a person's monthly salary as determined. If the status is Technician the person receives RM70 perday for 26 days work in a month. If the status is Lecturer the person receives RM200 perday for 26 days work in a month. if the …

Member Avatar for Schol-R-LEA
0
145
Member Avatar for chrispitt
Member Avatar for melonhed85

I'm working on a struct array and I need to dynamically delete elements from the struct. I have the added dynamically but I've run into some issues with deleting. I've researched different methods and tried a few. I found that one from here works, in that it will delete the …

Member Avatar for Schol-R-LEA
0
3K
Member Avatar for CodyOebel

I am used to c++ straight forward winAPI functions, but decided I need to learn c# and this whole .NET stuff since I'm stubborn like that. What I'm wondering is how do I set an HWND ? In c++ I would use something like HWND hwnd1 = FindWindow(0,"Title of the …

Member Avatar for CodyOebel
0
114
Member Avatar for ferizhandi

hi all; i have run this code and the first read and write work correctly. but and the second one is missed. the output log is: freez@JALALI:~$ ./a salam8a okok2freez@JALALI:~$ #include <stdio.h> int main() { write(1,"salam",5); char a[2]; char b[5]; read(0,a,2); if(a[0]=='8') {write(1,"ok",2); read(0,b,5); write(1,"ok2",3); } return 0; }

Member Avatar for Schol-R-LEA
0
170
Member Avatar for erinkay528

**Here is the assignment:** Write a C++ program to calculate and display the number of primes in the first 50 “chiliads”. Your results should be exactly as presented below, under testing. Design Considerations: I think you will find your program easier to structure and write if you break it down …

Member Avatar for tinstaafl
0
329
Member Avatar for newbie14

We have a packet capture function which is as below. The issue now each of the hex value of packet I read and concat into a char *hex2Value using this code below. I would like to know is this the most efficienct method to concat all into one single string …

Member Avatar for newbie14
0
242
Member Avatar for Haquo

Hello all, I was hoping You could help me with this. The code below is for the login screen in my project. the data is selected from UsersList (UserID,FirstName,LastName,UserDOB,UserUsername,UserPassword,UserAdmin) What way can I modify the "cmd" command to check if the value for UserAdmin is true and display a message …

Member Avatar for akvasov
0
2K
Member Avatar for fady.a.samy

The mini-supermarket already has a list of product names and their corresponding type (soap, oil, milk, cheese, etc….) included in it initially. The user menu displays the following operations: (Hint: Use the function gets to read an array of characters including spaces) - Insert a product (name, type) - Display …

Member Avatar for jephthah
-1
202
Member Avatar for amrita29april

[code] #include<stdio.h> #include<conio.h> #include<string.h> void main() { char str[80],temp[80],word[20]; int i,j=0,c=0; gets(str); gets(word); strcat(str," "); for(i=0;str[i]!='\0';i++) { if(str[i]!=' ') { temp[j]=str[i]; j++; } else { temp[j]='\0'; if(strcmp(temp,word)==0) c++; } } printf("%d",c); getch(); } [/code] now my problem is that it is counting only the first word.. what's wrong with the …

Member Avatar for jephthah
0
268
Member Avatar for nitin1

can anyone explain me the all precison and exponent, significant bits which double can handle ? i am not getting it. wiki says it has 53 bits significant bits and 11 exponent. am a little bit confused. can anyone explain me ? (in their own way) thanks alot. although i …

Member Avatar for jephthah
0
165
Member Avatar for fafa70

hi. i create a server and client and i have a text based connection between them. firstly client sends a message to server and client gets the answer but after that client sends another message to server and when client wants to get the message, it shows empty message. important …

0
102
Member Avatar for fafa70

hi. i have problem with following code: when i give address directly it works correct but when i get address from command line, it does n't work. int main(int argc, char** argv) { int size; int fd,fd2; char buf[10000],buf2[10000],FileAdd[10000]; size = read(fd2,buf2,10000); //char *FileAdd = malloc(size); strcpy(FileAdd,buf2); if ((fd= open(FileAdd, …

Member Avatar for fafa70
0
342
Member Avatar for ronnelayson

Please help me with this code. when i tried to run it, it doesn't continue to this part "printf("\n\n Money: ");" but when i tried to change the data type of money to integer it does continue, but i need a float data type. please help, thank you. #include<stdio.h> #include<conio.h> …

Member Avatar for ronnelayson
0
110
Member Avatar for prathiyus

im trying to send image from one system to another(client server model),it works fine when i use loopback ip address(same machine as both client and server) but when trying to send to another system,the gimp doesnt recognize the image and displays an error after receiving the image... here is the …

Member Avatar for prathiyus
0
5K
Member Avatar for Anonymous3

private void update() Int64 sum = 0; sum = (!string.IsNullOrEmpty(Request.QueryString["Id"])) ? Int64.Parse(Request.QueryString["Id"]) : 0; if (sum != 0) - Here in Debug mode, i get this condition is false and equals 0 { var context = new myDatabase(); var s = context.myTableName.FirstOrDefault(c => c.Id == sum); if (s!= null && …

Member Avatar for Anonymous3
0
228
Member Avatar for mohammad.alsheyab

Huffman Code In this assigment, you need some text files. Click HERE to download some. In this assignment, you are to implement the Fixed-length Huffman coding that we learn in the class. You should perform the following: 1- Huffman Encoder. a. This is a C++ program that reads as input …

Member Avatar for Ezzaral
0
217
Member Avatar for Babymonkeystuff

**I am trying to read the records from and to a CSV file in C. Of course i want to stop when I have read all the records. If I use a for loop it works perfect except I have to know how many records there are. if I change …

Member Avatar for rubberman
0
4K
Member Avatar for nitin1

can you tell me the approach that i have k*n nodes where k,n are integers and no two adjacent nodes can have same colours and i want to colour the trees with n colours. (i am making trees not graphs.) thanks. any help will be appreciated.

Member Avatar for nitin1
0
71
Member Avatar for aqzee

i have tried so much to understnd this problem but can't able to get it.. plxx tell me how it will b solve or atleast give me syntax.!! this is the header file that i had made.. // A 2-dimensional point class! // Coordinates are double-precision floating point. class Point …

Member Avatar for deceptikon
0
263
Member Avatar for mudbubbleb

I am looking to finish up this program for class. I'm lost when it comes to arrays and I've read all the course work, the book, etc. The question is how do you increase an array element at the position? using namespace std; int main() { int quantity[4][5], warehouse, product; …

Member Avatar for vmanes
0
148
Member Avatar for Drgy55

Please read this whole post before commenting. I am new to programming in C. The problem I have is from Kochan's "Programming in C," Chapter 6, Exercise 6. The problem states that I need to take user input (some integer) and display it in english. Ex. User inputs "123", output …

Member Avatar for Moschops
0
279
Member Avatar for russendel

[Click Here](http://answers.yahoo.com/question/index;_ylt=AlQJPiETIJOaaftERf6r1l7sy6IX;_ylv=3?qid=20130507233149AAQXvZ6) answer this please...

Member Avatar for rubberman
0
126
Member Avatar for nomorelogic

i would like to have the ability to tell the player they cannot go that way if the exit does not exist the rooms are in a text file that is read in, i know i should use a if function but dont know where to put it, any help …

Member Avatar for spuriousgeek
0
282
Member Avatar for hammy2013

The full structure of a C++ program to compare two strings and check whether they are equal

Member Avatar for ddanbe
-1
126

The End.