Arbus 25 Practically a Master Poster

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...

for(a=0;a<1000;a++)
{  c=(a*a*a)-(a*a);
   if(b==c)
   { 
      printf("%d",a);
     }
}
Arbus 25 Practically a Master Poster

hello chirag mittal,
Here is an example of do while loop in your program.

void main()
{  .
   .
   .
 setprecision(2);
do
{  clrscr();
   .
   .
   .
   switch(ch)
   {
    case 1:  ... 
    case 2: ....
     .
     .
     . 
    default:
          ...//remove the goto in default
  }
 }while(yn!='y');
}

the above do while loop displays the first menu(bill reports,show edit item,add/remove etc.,) till you exit.
Likewise replace all goto's with do while

Arbus 25 Practically a Master Poster

Hello sudipan007...
a=1 and not a==1.

if(i%j==0)
{a=1;
}
Arbus 25 Practically a Master Poster

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

Arbus 25 Practically a Master Poster

You can use do while loop for the whole block and give the condition in the do while loop as...

}while(yn!='y');
Arbus 25 Practically a Master Poster

The logic of your program is wrong.A prime number has only two factors,1 and the number itself.In your program odd numbers would be displayed because it is not divisible by 2.
15%2!=0 ,so 15 will be displayed though its not a prime number.
Try this one

int c,d,e=0;
for(c=2;c<=300;c++)     //excluding 1 as 1 is neither prime nor composite
{for(d=2;d<300;d++)
 {if(c%d==0)
  {e=e+1;   //keeping count of the factors
  }
 }
 if(e==1)
 {cout<<c<<" ";
 }
 e=0;
}
Arbus 25 Practically a Master Poster

Hi friend,the header files i included are iostream.h,conio.h and graphics.h.

Arbus 25 Practically a Master Poster

Hello friends.Can anyone help me in this.Here is the code.

circle(320,240,100);
textmode(BW40);
cout<<"\n\n\n\n\n\n\n\n\n\n\t\thello";

The problem is hello is displayed without circle.

Arbus 25 Practically a Master Poster

strings are collection of characters that you enclose it with double quotes.
eg:

char a[5]="world";

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.

Arbus 25 Practically a Master Poster

I have done a program which gives a graphics text if its location matches the specificed location in the directory,that is the graphics text("welcome...") will be shown only if the file is kept in a foder say music.I have done it using getcwd().I want to that any facilities are there to execute it,if the folder is opened.

Arbus 25 Practically a Master Poster

Iam not sure about this solution..
every string is ended with null character or \n.try this block...
do
{character=getchar();
sentence[counter++]=character;
}while(character!='\n');
sentence[counter]='\0';
puts(sentence);

Arbus 25 Practically a Master Poster

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

Arbus 25 Practically a Master Poster

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???

Arbus 25 Practically a Master Poster

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

Arbus 25 Practically a Master Poster

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.