Posts
 
Reputation
Joined
Last Seen
Ranked #622
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
82% Quality Score
Upvotes Received
19
Posts with Upvotes
17
Upvoting Members
13
Downvotes Received
4
Posts with Downvotes
4
Downvoting Members
3
11 Commented Posts
~126.40K People Reached
Favorite Forums
Favorite Tags
c x 139
pow x 12
c++ x 10
Member Avatar for cse.avinash

Hello every one Can I have a better algorithm to find the nth prime number, where 1<= n <=5000000. for e.g., 1st prime number is 2. 10th prime number is 29. 100th prime number is 541. 1000th prime number is 7919. 10000th prime number is 104729. 100000th prime number is …

Member Avatar for vantrendin
1
6K
Member Avatar for mayankjoin
Member Avatar for D33wakar
0
345
Member Avatar for D33wakar

This is a simple echo server that I've written while learning sockets programming. Compile the server and run it. You can connect to it using telnet like this: telnet localhost 1337 Disconnect the client by typing "/quit" without quotes.

0
378
Member Avatar for D33wakar

This is a simple hangman game that I wrote using my beginner python skills. Though this game is playable, there must be lots of things I must've been doing wrong or the methods I'm using here may be not so pythonic. So I want some suggestions on how to improve …

Member Avatar for TrustyTony
1
707
Member Avatar for MrNo

[CODE]#include <stdio.h> #include <string.h> int main() { int count = 0; char *doc; FILE *inp; printf("Enter the file name: "); scanf("%s", doc); inp=fopen(doc, "r"); while((doc = fgetc(doc)) != EOF) { if (doc == ' ') count++; } fclose(doc); printf("%s contains %d words\n",doc,count); return 0; } [/CODE] So basically I'm a …

Member Avatar for zeroliken
0
314
Member Avatar for Lillylionhert

I am working on a Priority Based Scheduler which reads the process in from a file. I have it reading from file and printing to the screen. I'm trying to use strtok to tokenize a line from the process test file and store it in three different arrays. The layout …

Member Avatar for Lillylionhert
0
4K
Member Avatar for D33wakar

If there's a list like below [CODE]s=['b','a','r','r','i','s','t','e','r'][/CODE] and if I tried to remove every 'r' from the list like this [CODE]>>> for x in s: if(x=='r'): s.remove(x)[/CODE] it gives the following result. [CODE]>>> s ['b', 'a', 'i', 's', 't', 'e', 'r'][/CODE] Why isn't the last 'r' removed from the list.

Member Avatar for D33wakar
0
101
Member Avatar for gizmo7008

I am trying to find the longest common prefix of two words entered by the user. I don't understand what is going wrong. I keep getting this error when I compile: [CODE]prefix.c:11:13: error: expected declaration specifiers or '...' before '(' token [/CODE] And this is my code: [CODE]#include <stdio.h> #include …

Member Avatar for WaltP
0
905
Member Avatar for Master Mascus

anyone can tell me what this line does? [CODE]return ('A' + c1 - 'a'); [/CODE] its in this function.. [CODE]char LToU(char c1) { if ((c1 >= 'a') && (c1 <= 'z')) return ('A' + c1 - 'a'); return(c1); } [/CODE]

Member Avatar for D33wakar
0
116
Member Avatar for Liuhh00

hey everyone on Daniweb, I'm liuhh00 in need of some dire suggestions for my program. I can't seem to solve why my program is not working right after i select my choice for case. The program is suppose to accept any 20 random integers, store them and allow the user …

Member Avatar for D33wakar
0
124
Member Avatar for Ich bin würdig

Does someone know how to integrate a collection of programs as one whole program? Thanks. :)

Member Avatar for Smeagel13
0
94
Member Avatar for The 42nd

Hello to all. I have a problem with replacing a part of a string with another string. The following code does not work. However, if you remove void in front of replace_str, in Code Blocks i am able to run it (WHY???) despite the fact that i still get a …

Member Avatar for The 42nd
0
306
Member Avatar for Daniel85

***I have a feeling that there might be something wrong with my function int fgetAnswers(int*pos, char res[], FILE*inp); I am able to compile, but the problem is that wherever the black screen appears, a box would pop out saying that the program has stopped working. Can any of you guys …

Member Avatar for Daniel85
0
161
Member Avatar for terence193

This is what the question is asking: Write a program to get the user to enter a positive number. Validate the input so any negative or zero number entered is rejected and the user is to re-enter the number. and this is what i have done [CODE]#include<stdio.h> int main (void) …

Member Avatar for YAMNA MIDHAT
0
197
Member Avatar for ram619

This is a piece of code from some book. According to book, this code must not have worked and should have given a error message saying "cannot convert parameter 1 from 'const char[15]' to 'char*'" but this code is running on turbo C giving just a error message of const …

Member Avatar for ram619
0
193
Member Avatar for ahp@aol.in

Hi folks, I'm trying following code.. [CODE] #include<stdio.h> int calsum(int a,int b,int c); int main(){ int x,y,z,sum=0; printf("Enter the 3 numbers:\n"); scanf("%d%d%d",&x,&y,&z); sum=calsum(x,y,z); printf("The vlaue of sum is :%d\n",sum); return 0; } int calsum(int a,int b,int c){ int d=0; printf("The value of d is:%d",d); d=a+b+c; } [/CODE] ** (1) ** …

Member Avatar for D33wakar
0
168
Member Avatar for DmytriE

Hi all! I am having trouble accessing dynamic information. I have used the malloc command to allocate the necessary memory for my struct. However, when I leave that function and enter a display function it says there is a problem accessing the information in the struct. I just had a …

Member Avatar for D33wakar
0
109
Member Avatar for jtbens01

I've searched google and tried several different things but I can't figure out how to read strings into a two dimensional character array and also read doubles into separate arrays all from the same text file. Please provide any help you can and let me know how you might accomplish …

Member Avatar for jtbens01
0
192
Member Avatar for thendrluca

This is my first post on daniweb :) and i am a beginner in C programming and i don't know so good english :) sorry! This is my program My problem consist of I run the program and i can't get to the [B]scanf("%c",&q);[/B] [I]/* Row 21 after printf. */[/I], …

Member Avatar for thendrluca
0
321
Member Avatar for vinodhsml

[CODE]#include<stdio.h> #include<conio.h> //header file declaring void main() { int a,i; clrscr(); printf("\n Enter the Number:"); //get value scanf("%d",&a); if(a%2==0) { printf("\n Not prime number"); } else { for(i=3; i<a; i=i+2) { if(a%i==0) { printf("\n Not a prime"); break; } } printf("\n Prime number"); } getch(); } [/CODE]

Member Avatar for reojavier
-1
128
Member Avatar for ram619

can anyone please tell me whats actually happening in this code. Seems to be as if incremented pointer is pointing to the next bit of same int. Answer is 2,0 Thanks in advance [code=c] #include<stdio.h> #include<conio.h> void main() { int arr[3]={2,3,4}; char *p; p=arr; p(char*)((int *)(p)); printf("%d",*p); p=(int*)(p+1); printf("%d",*p); getch(); …

Member Avatar for Narue
0
347
Member Avatar for VengefulToast

Hey forum, our professor assigned us a program we have to write in assembly language and I would love to have help on it. [QUOTE]Write an upper-to-lower case and lower-to-upper case conversion program. When the user inputs a letter, your program should convert it to upper case if it is …

Member Avatar for D33wakar
0
563
Member Avatar for whitech

i have to find proper divisors of a positive integer.for instance,the proper divisor of 15 are 1,3,5. input 15 output 1 3 5 like that. Thank you for your helps.

Member Avatar for cse.avinash
0
194
Member Avatar for mameemonster

hi. this is my program for bus ticket detail. at the bottom of my program, i want user to input yes or no for loop this program. but before i can input anything, it already told me that 'Please input the correct answer'. it is like i already input something. …

Member Avatar for D33wakar
0
140
Member Avatar for mameemonster

hello. i have a problem in selecting destination and time. when i select any number in destination the program always tell me that i choose number 1 (taiping). and the time it always show 1030 even i input number that is not 1. please tell me where i'm wrong here. …

Member Avatar for mameemonster
0
111
Member Avatar for Liuhh00

hey guys lol i spent 5 hrs thinking about building this asterick pattern and i am still getting troubled by the spacing for the 3rd pattern , anyone can help me to reduce 1 spacing so the 3rd pattern isn't out of place?XD [CODE]#include <stdio.h> int main() { int c,c_2,c_3,c_4,c_5,c_6,c_7,c_8; …

Member Avatar for Liuhh00
0
129
Member Avatar for mkab

Hello everyone. I'm trying to code the cd shell command in c. I used chdir function to code it but the problem is that when I execute the program on the terminal it doesn't change the directory. I kept a series printfs and conditions to test if it changes, though …

Member Avatar for mkab
0
6K
Member Avatar for joshThtch

Building a phonebook program for school--very much a work in progress. I still need to write a sort function, tweak my delete function, etc. But actually what I'm hoping you folks could answer is hopefully simpler--for some reason I seem to have a while loop that is executing twice, and …

Member Avatar for joshThtch
0
201
Member Avatar for Locke123

I have a subroutine that is passed a pointer to a bit string in the si reg and an index in the ax register. I declared the val variable in the data seg [CODE]getbit: cmp ax, 1783 ; max value of the index being passed ja goback push si mov …

Member Avatar for Locke123
0
204