Posts
 
Reputation
Joined
Last Seen
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
19% Quality Score
Upvotes Received
4
Posts with Upvotes
4
Upvoting Members
4
Downvotes Received
26
Posts with Downvotes
16
Downvoting Members
14
8 Commented Posts
~52.6K People Reached
Favorite Forums
Member Avatar for Josue198s

#include<stdio.h> int main() { int pcheck=1,i; int k=1000 for(i=2;i<k;i++) { if((k%i)== 0) { pcheck=0; break; } } if(pcheck) { printf("%d is a prime .\n",k); } else { printf("%d is not a prime.\n",k); } return 0; } this code works to check any number i that write in k but when …

Member Avatar for rajii93
0
220
Member Avatar for Paritosh Das

[CODE]#include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include<dos.h> int main(void) { int gdriver = DETECT, gmode, errorcode,i; int midx, midy; int radius = 100; initgraph(&gdriver, &gmode, "c:\\tc\\bgi"); errorcode = graphresult(); midx = getmaxx() / 2; midy = getmaxy() / 2; setcolor(getmaxcolor()); for(i=5;i<=90;i+=2) { delay(50); setcolor(i); circle(midx+i, midy-i, radius); setcolor(i); …

Member Avatar for josephbeluan
-2
130
Member Avatar for SacredFootball

I think the code comments show what is needed. Essentially, I just need to spit out the members name and score who are below the average score in the list. [CODE] void displayLowScore(struct payload *arrayStart , //first element of array struct payload *arrayEnd ) //last element of array { int …

Member Avatar for SacredFootball
0
153
Member Avatar for DJSAN10

Are constants, defined by using the keyword const , external linkage or internal linkage? Can constants be modified using pointers? What about constants defined using by #define?

Member Avatar for DJSAN10
0
129
Member Avatar for mahban

I need to yourhelp,too. can you write this programm :sum and multy 2 sparsematrix with linklist?(language c++)

Member Avatar for peter_budo
0
67
Member Avatar for alexchen

What is the difference between using system("pause") and cin.get(pause)? [URL="http://www.daniweb.com/forums/post1446085.html#post1446085"]Oliver [/URL]told me never use system("pause"). [code] #include<string> #include<iostream> int main(){ using namespace std; string str = "My name is shridhar"; cout<<"What is your name"<<str; char pause = 0; cout << "Press enter to continue..."; cin.get(pause); } [/code]

Member Avatar for VernonDozier
0
343
Member Avatar for realproskater

/*I have to write code for the Game of Life. I wrote nearly all the code for it but for some reason when I run my second generation it just displays the same one as before. Here is my code any idea on why this is happening would be greatly …

Member Avatar for alexchen
0
6K
Member Avatar for mackemforever

I've been set in a lab session at University the task of creating a program which can perform one of a variety of calculations, with it performing the one specified by the user, and with it looping back after every calculation however it is the looping which is causing me …

Member Avatar for chrjs
0
145
Member Avatar for dos_killer

hello im new to linux programming and i am experiencing a bit of diffuclty with pthreads...basically the pthread_create() function in my code below i tend to pass an integer variable as the argument for my runner() function but i get a warning and an error..i have tried several ways of …

Member Avatar for gerard4143
0
755
Member Avatar for katisss

#define print_int(a) printf("%s : %d\n",#a,(a)) int y=10; print_int(y) i am taking a class and have been asked to explain why this is bad... So i guess stringifing #a is the problem. It does work, so why is it dangerous?

Member Avatar for katisss
0
78
Member Avatar for Paritosh Das

[CODE]/*Simply change the path in initgraph(&gdriver, &gmode, "d:\\TC\\BGI"); e.g if your working directory is E write "E:\\TC\\BGI"*/ #include<graphics.h> #include<stdio.h> #include<conio.h> #include<math.h> #include<dos.h> int main() { float i,k,r; int gdriver = DETECT, gmode,c,j,l=57,m=56; initgraph(&gdriver, &gmode, "d:\\TC\\BGI"); printf("House constructed by Paritosh:"); printf("\nFor the visibility in different colors enter any integer: "); scanf("%d",&c); …

Member Avatar for Adak
-1
137
Member Avatar for Dexxta27

[CODE]typedef struct electro { char name[20]; int access_number; char address[50]; float balance_due; }; electro account[10]; electro account[0].balance_due=$ 120.52; electro account[0].address[50]={Cane Gardens};[/CODE] Can someone tell em how to correct this piece of code. I'm using Codeblocks and it says it " expected an initializer before '.' " in the two last …

Member Avatar for Dexxta27
0
208
Member Avatar for Paritosh Das

[CODE]#include<stdio.h> #include<conio.h> #include<graphics.h> #include<dos.h> void main() { int gd=DETECT,gm,year,month,day,cy,cm,cd,i,j,maxx,maxy; int y,m,d; int midx, midy; int stangle = 0, endangle = 360; int xradius = 100, yradius = 50,xradius1 = 2, yradius1 = 2; int radius = 50; clrscr(); initgraph(&gd,&gm,"d:\\tc\\bgi"); maxx=getmaxx(); maxy=getmaxy(); for(i=0;i<10;i++) { setcolor(4); rectangle(i,i,maxx-i,maxy-i); rectangle(9,11+i,629,45-i); } for(i=0;i<315;i++) { delay(3); …

Member Avatar for jonsca
-2
367
Member Avatar for Jcastillo2010

(Linux)I am trying to use this code: /* *Converts pounds to kilograms. */ #include <studio.h> /* printf, scanf,definitions*/ #define KG_PER_POUND .4536 /*conversion constant */ int main(void) { double pounds, /* input - weight in pounds. */ kg; /*output - weight in kilograms */ /* Get the weight in pounds. */ …

Member Avatar for Trentacle
0
168
Member Avatar for shabbo_03

im doing a college project in c++. it is a token system of bank(line,queue..).it waits for a enter key and then it creates a token with entry time and expected leaving time,cashier to attend to and token no. whenever i compile the program it gives no error but after runing …

Member Avatar for mbulow
0
348
Member Avatar for balwin

i have written the code and tried to compile, but it always say that the file can't be read, yet i have put the same name file in one directory with the c++ file. need your help so can read the file on my mac.. #include <iostream> #include <fstream> #include …

Member Avatar for Fbody
0
172
Member Avatar for somshridhar

Dear Sir, I am trying to print the string with the following code, but I am getting errors like Undefined symbol 'string' Undefined symbol 'str'. [CODE]#include<conio.h> #include<string.h> #include<iostream.h> void main() { string str = "My name is shridhar"; cout<<"What is your name"<<str; getch(); } [/CODE] I think the problem is …

Member Avatar for kernel>panic
0
4K
Member Avatar for raymondchew2007

Consider and ADT list of integers. Write a function that computes the sum of the integers in the list aList. The definition of your function should be independent of the list’s implementation. may i know how to do this type of question?

Member Avatar for kernel>panic
0
129
Member Avatar for lochnessmonster

if i were to do this in a program, would it possibly overwrite data/memory that is already being using by my application? int main() { char *pointer = "hi"; pointer = "weeeeeeeeeeeeeeeeeeeeeee"; return 0; }

Member Avatar for taylorg
0
77
Member Avatar for user543820

hi! i want to print a colored 'A' using putchar, let's say green. i am able to print * by doing just putchar('A'); but i don't know that how to print a colored 'A'. i have also tried to write: putchar('A',255); and also putchar('A',3); but no success.

Member Avatar for embooglement
0
236
Member Avatar for mahesh20081984

Hello, How can i create / edit the details that shown in the property -> version tab of an executable file . ie which can be taken from window's explorer mouse right click context of an exe file. The exe file was created using MINGW and qmake. thanks in advance …

Member Avatar for alexchen
0
83
Member Avatar for alexchen

I need to calculate the area of a triangle using this formula. What is wrong with my code? error C2063: 'p' : not a function [CODE]#include <stdio.h> void Area(int a, int b, int c) { int p = a * b * c; int area = (p(p - a)(p - …

Member Avatar for alexchen
0
112
Member Avatar for nalasimbha

Hello, I have a dll that I wrote and a driver program to call that dll. Both the programs were written in VC++ 2008 express edition. The program takes in 2 strings as a command line argument and passes it to the dll which prints the 2 strings in the …

Member Avatar for Narue
0
301
Member Avatar for alexchen

I am trying to print a rectangle using this symbol *. When I print it, it draws an L. What is wrong with my code? [CODE]#include <stdio.h> void rect(int base, int height) { int x = 0,y = 0; while(x < height) { x++; if(x == 1 || x == …

Member Avatar for alexchen
0
164
Member Avatar for petmol

Hi friends, I have an assignment to put three little programs into one, making each one a function of the main program, which is a kind of menu. The three work perfectly as separate entities, but when I put them together, the thing won't compile. Can anyone tell me what's …

Member Avatar for pranaymahajan
0
133
Member Avatar for iamuser_2007

[CODE]// Cubic conversion of Borwein's Algorithm // Each iteration converges // cubically against 1/pi; // that is, each iteration // approximately triples the // number of correct digits. // Program written by ROBO_HEN5000 // Algorithm complements of Wikipedia. #include <iostream> #include <cmath> using namespace std; int main() { float a; …

Member Avatar for Sokanas
-3
136
Member Avatar for Badoodhi
Member Avatar for alexchen
-5
117
Member Avatar for sankalp_999

i have written a program in c++ using the concept of file handling. this program is about managing a basic electronic hardware store stock and showing the sales report. i am not able to understand why the [B]contents of my file are not being displayed, modified, deleted, or even printing …

Member Avatar for sankalp_999
0
2K
Member Avatar for svatstika

Hi everyone! I'm reading a book and doing some exercises in this book. One of them is: define a class, which implements arithmetic (+, -, /, *) with arbitrary precision. This is a new type with just some arithmetic operations. With type double we also can do some arithmetic but …

Member Avatar for svatstika
0
184
Member Avatar for mbouster

Dear all, I would like to ask you how to initialize the following: I want to initialize a class inside another class. How I will be able to do so? An example: [CODE]/*Class Date*/ class Date { public: Date(){} // default constructor int day;//day of the month valid till 31 …

Member Avatar for mbouster
0
279