121 Posted Topics

Member Avatar for chess2009

Hello chess 2009, Empty lines are displayed if there are multiple spaces between the two words. Try this logic in the [COLOR="Green"]if else[/COLOR] block. If there are one or more spaces between the set of characters,the cursor should go to next line.Try this... [CODE]if(c!=' ' && c!='\t' && c!='\n' && …

Member Avatar for WaltP
0
432
Member Avatar for george61

Hello george61, I think the problem is in the for loop which reverses the array. [CODE]for(int i = (str1size - 1); i>=0; i--) { n = (str1size - 1) - i; str2[n] = str1[i]; //<-- problem }[/CODE] I think the whole string("9009" or "2345") gets into str2[n] without getting reversed, …

Member Avatar for b56r1
0
110
Member Avatar for chirag_mittal

You can use do while loop for the whole block and give the condition in the do while loop as... [CODE]}while(yn!='y');[/CODE]

Member Avatar for chirag_mittal
0
234
Member Avatar for dspjm

No.Both abort() and exit() terminate the program and not the function only. Abort() ends the program with "abnormal program termination".It indicates unsuccessful termination of program.

Member Avatar for dspjm
0
1K
Member Avatar for stan2000

Hello stan2000, The problem is in your for loop. You initialized total_pay as 0.01. Inside the for loop total_pay gets added to pay*2 which value on day 1 becomes 0.03( that is 0.01+ (0.01*2)). so the total_pay will not start from 0.01. To start total_pay from 0.01 you should initialize …

Member Avatar for Arbus
0
154
Member Avatar for slygoth

Hello slygoth, There is a simple way to do this. Initialize a character a and write [COLOR="Green"]a=getch()[/COLOR]. This would not display the character entered by the user. [CODE]char a; a=getch(); // varable a will have the character entered by the user.The character cout<<'*'; // entered by the user will not …

Member Avatar for Arbus
0
336
Member Avatar for slygoth

Hello slygoth, You should include ctype.h for using toupper. To convert lowercase letter to uppercase you should give [CODE]pick=toupper(pick); [/CODE] If the user enters 'a' you can convert it to 'A' using the above.

Member Avatar for jnawrocki
0
167
Member Avatar for Arbus

Hello friends, I am trying to play music through turbo c++.I used Irrklang sound library 1.3.0. But while compiling i get an error saying "unable to include IK_IRRKLANGTYPES.h" and other header files. Should i change anything in header files? Is there any other way to play music in turbo c++? …

Member Avatar for Kanoisa
0
417
Member Avatar for Lokril

Hello Lokril, try this.... [CODE]#include<iostream.h> #include<conio.h> int remainder(int x,int y) {int d,e; d=x/y; e=x-(y*d); return(e); } int main() {. . .// code that you just posted }[/CODE]

Member Avatar for jonsca
0
144
Member Avatar for Arbus

Hello friends, I am having a trouble with dosbox 0.72. I opened turbo c++ using dosbox and tried a program. But it throws an error 'unable to create hello.obj'. my program [CODE]#include<iostream.h> #include<conio.h> void main() { cout<<"hello"; }[/CODE] I gave this while opening turbo c++ in dosbox... Z:\>mount c d:\turboc3\ …

1
91
Member Avatar for Arbus

Hello friends, I am having a trouble with dosbox 0.72. I opened turbo c++ using dosbox and tried a program. But it throws an error 'unable to create hello.obj'. my program [CODE]#include<iostream.h> #include<conio.h> void main() { cout<<"hello"; }[/CODE] I gave this while opening turbo c++ in dosbox... Z:\>mount c d:\turboc3\ …

0
63
Member Avatar for Madmark88

Hello madmark, you have declared 'a' twice,one in the begining and other in the for loop. So the compiler will throw an error("multiple declaration error"). Try this... [CODE]for(a=0;a<1000;a++) { c=(a*a*a)-(a*a); if(b==c) { printf("%d",a); } } [/CODE]

Member Avatar for Trentacle
0
161
Member Avatar for neuro

your program works finely.But it throws floating point error if the value of b*b is less than 4.0*a*c,because sqrt are not meant for negative numbers. Also use getch() at the end of the program before return(0),so that the output is displayed till you press a key. getch() prototype-conio.h

Member Avatar for neuro
0
179
Member Avatar for sudipan007
Member Avatar for WaltP
0
98
Member Avatar for Arbus

Hello friends.Can anyone help me in this.Here is the code. [CODE]circle(320,240,100); textmode(BW40); cout<<"\n\n\n\n\n\n\n\n\n\n\t\thello";[/CODE] The problem is hello is displayed without circle.

Member Avatar for JSPMA1988
0
132
Member Avatar for simply_viks

you have declared the array having 64 elements only(char pste_msg[64]) -----

Member Avatar for hillstone_softw
0
189
Member Avatar for divyasphoorthy

strings are collection of characters that you enclose it with double quotes. eg: [CODE]char a[5]="world";[/CODE] a[0] will have w a[1] will have o a[2] will have r a[3] will have l a[4] will have d.

Member Avatar for WaltP
-2
84
Member Avatar for Arbus

i want an .exe file to be automatically executed if a folder having that particular file is opened,that's if you open the folder the file should get executed automatically.I want this to do in c++.can somebody help???

Member Avatar for ravenous
0
97
Member Avatar for Arbus

can somebody explain me about parameters in initgraph in c++ graphics???

Member Avatar for mrnutty
0
64
Member Avatar for divyasphoorthy

An array is a collection of elements of same datatype. int a[100]; the above is an example of integer array having hundred values. accessing array... for(c=1;c<=100;c++) cin>>a[c]; //accepting integer values from the user.

Member Avatar for Arbus
-2
74
Member Avatar for Dekea

here is a simple method to sort strings using bubble sort [code=c] #include #include #include #include void main() {clrscr(); int c,d,e,f,g,h,i,j,k,l; char a[100][100],b[100]; cout<<"how many strings you are going to enter"; cin>>d; for(c=0;c<=d;c++) gets(a[c]); for(c=0;c0) {strcpy(b,a[c]); strcpy(a[c],a[c+1]); strcpy(a[c+1],b); } } } for(c=0;c

Member Avatar for Dekea
0
204

The End.