zeroliken 79 Nearly a Posting Virtuoso

try to check the beginning and end of the indeces of the string if equal. The index starting from the beginning to increment and the index starting at the end to decrement and comparing both of them
e.g.

       //here int i is the counter of the index from the start of the word and j from the end and n as the counter to check if the word is a palindrome
       j = strlen(string) - 1;
       for(i = 0; i <= j ; i++,j--){                   
           if(string[i]!=string[j]){                
               n=1; //counter tells that the sting is currently not a palindrome                                 
               break;  //once found that character doesn't matches it breaks from the loop                             
           }
           if(string[i]==string[j]){                
               n=0; //counter tells that the sting is currently a palindrome                                
           } 
       } 

then print the word is not a palindrome if the value of n is 1 else a palindrome

zeroliken 79 Nearly a Posting Virtuoso

This could easily be solved with the strrev function from the string library
here's a link with the answer

zeroliken 79 Nearly a Posting Virtuoso

check the regex Pattern class and experiment with the constructs and matches method

zeroliken 79 Nearly a Posting Virtuoso

111100/11000: strcpy doesn't compare but compys from one string to another

you missed reading a word in my previous comment

... and strcmp in comparing the 2 string

111100/11000 commented: Thanks +0
zeroliken 79 Nearly a Posting Virtuoso

try to use strcpy in assigning a value to chouseing_alphabet and strcmp in comparing the 2 string

zeroliken 79 Nearly a Posting Virtuoso

could you post a more detailed description of the problem

zeroliken 79 Nearly a Posting Virtuoso

line 42: try

int answer(int x,int y)

now there is another problem . I don't get answers to 11xanything ,12xanything. help

next change to the ff.

at line 5: int mutab[12][12];
at line 10: for (int h=0;h<12;h++)
at line 18: for (int i=0;i<12;i++)
at line 31: for (int k=1;k<13;k++)

zeroliken 79 Nearly a Posting Virtuoso

ideapad LENOVO laptop with Intel(R) Core(TM) i3 CPU m 370 @4.20GHz
and ram= 2.00GB

if it's just for programming or computer science need then your specs is more than enough.
Mine is about the same as yours though I'm using an acer laptop and I haven't
encountered any problem in my years

but my classmate told me that a LENOVO laptop is a trash and i was hurt is that true?

did you ask why does he think it's trash?

zeroliken 79 Nearly a Posting Virtuoso
  1. follow exactly the pseudocode to get your porgram to work (you only need 2 loops)
  2. I suggest you use only while loops
  3. include the j=0 at the start of your first loop as the counter for the number of asterisks you need to print every time
zeroliken 79 Nearly a Posting Virtuoso

It prints out 0 because it takes noOfdigits, stores a copy then adds 1 and returns the copy. So you get the value of what it was, but also increments it at the same time. Therefore you print out the last value though it gets incremented.

zeroliken 79 Nearly a Posting Virtuoso

could you give an example of which digit is chosen for leftPivot and median of three if it's an extreme(where the digits would be placed in a skewed pattern) then there's your problem... the wrong choice of pivot
just my assumption

zeroliken 79 Nearly a Posting Virtuoso

What do you mean by doesn't pause correctly?

The first one and second one works the same
also at the first code there's a trailing semicolon on the for loop @ line 44

for(x=0;x<25;x++); {
zeroliken 79 Nearly a Posting Virtuoso

which one did you use?

if it's option 1 once the value of integer i changes the condition won't be met for the if statement

note: for my first post I didn't notice that the numbering changed when I entered the code, that's actually 4 options

zeroliken 79 Nearly a Posting Virtuoso

here's a few options I could think as of the moment:
1. use a conditional for the rest of the code in the function, e.g.

    void display(int a, int c, int g, int f1, int f2)
    {
        int i = 0; //or you could use a boolean

        while(f1==0&&f2==0)
        {
            cout << "This equation does not factor.";
            i = 1;
            break;
        }

            if(i == 0){
            //rest of the code
            }
    }
  1. you could exit the program once this happens
  2. you could use a function with a return type so you could return a value(end the function) after it prints equation does not factor.
  3. use a goto statement( not recommended)

my favorite is option 1 ;)

zeroliken 79 Nearly a Posting Virtuoso

here's a sample program I used that implements your code, if you have a specific code you're using feel free to post it:

int main() {

        int a[15][15], i, j, rows, num = 40, x;
        printf("\n Enter the number of rows:");
        scanf("%d", &rows);
        for (i = 0; i < rows; i++) {

               for (x = 40 - 3 * i; x > 0; x--)
                     printf(" ");

               for (j = 0; j <= i; j++) {
                     if (j == 0 || i == j) {
                         a[i][j] = 1;
                     } else {
                         a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
                     }
                     printf("%4d", a[i][j]);
               }
               printf("\n");
         }
    return 0;
}

if you input 6, its output looks like

                                           1
                                        1   1
                                     1   2   1
                                  1   3   3   1
                               1   4   6   4   1
                            1   5  10  10   5   1

which doesn't look equilateral to me (according to my terminal), is it required for you to use that?
and here's something that gives an equilateral look for me

               for (x = 25 - 2 * i; x >= 0; x--)
                     printf(" ");

which gives out this when the input is 6:

                             1
                           1   1
                         1   2   1
                       1   3   3   1
                     1   4   6   4   1
                   1   5  10  10   5   1

note: im using linux gcc as a compiler and this "might" look different on other compilers

zeroliken 79 Nearly a Posting Virtuoso

I tried a lot to understand the spacing procedure in pascal triangle.. but it all went to vein!!

do you mean the spacing between the integers on every line?
you need to be more specific on how you need the triangle to look like,
does it require you to use recursive functions?

also have you checked examples from the web like these, are they similar to what you require?
http://www.roseindia.net/tutorial/C/pascalTriangle.html
http://www.programmingsimplified.com/c-program-print-pascal-triangle

zeroliken 79 Nearly a Posting Virtuoso

if i want to make x the constant or in c u call define.,how can i go about?

before main,
#define x 2.55

zeroliken 79 Nearly a Posting Virtuoso

If that doesn't work then the problem is somewhere else (or different than you expect).

I think thines01 is right, just the code in the function wouldn't produce the error your receiving right now, could you post now all of the code or if you don't like check every line of the program to see if you miss any semicolon or wrong use of brackets

zeroliken 79 Nearly a Posting Virtuoso

you probably missed a semicolon or bracket on another line, could you post the rest of the code (better if it's the whole code)

zeroliken 79 Nearly a Posting Virtuoso

Did you post the whole code? I don't see any loop that will print the output again
I tried the program with linux gcc and windows cgwin compiler and got only one output...

zeroliken 79 Nearly a Posting Virtuoso

and also the full code

zeroliken 79 Nearly a Posting Virtuoso

So is there a problem you need help with?

zeroliken 79 Nearly a Posting Virtuoso

@ line 10
what's the use of that datatype? remove that

@ line 17
that variable has already been declared, why declare it inside a loop again

zeroliken 79 Nearly a Posting Virtuoso

12/12/2012 then the date for tomorrow displays a list of dates

could you post a sample output of the code
I'm unable to duplicate the problem since I got only one date for the output when I entered 12/12/2012

zeroliken 79 Nearly a Posting Virtuoso

Back in the old forum there used to be a list of admins and mods

Also Can I ask if you know what happened to Narue?

zeroliken 79 Nearly a Posting Virtuoso

other than the brackets did you already fix those variable initializations like what I said?

don't initialize variables inside a loop/condition

zeroliken 79 Nearly a Posting Virtuoso

when i add again a } at the end,the error now is 1

"error:class,interface,or enum expected"

you added an unnecessary closing bracket, check all the brackets again

zeroliken 79 Nearly a Posting Virtuoso

,and errors become 29.....

don't initialize variables inside a loop/condition

zeroliken 79 Nearly a Posting Virtuoso

In the changes you made did you check if you have a closing bracket for the public class?

zeroliken 79 Nearly a Posting Virtuoso

@ the function

for(int i = 0; i > nrEle ; i++){
for(int j = 0; j > nrEle; j++){

what's the value of nrEle that you passed to the function? if the value nrEle is less than the value of i and j then it will loop continuously and if the value of nrEle is greater than i and j then the condition won't be met to start the loop

zeroliken 79 Nearly a Posting Virtuoso

use opening and ending brackets for the while loop also why are there semicolons before the end of the parentheses' nested if conditions

other than that could you post those error messages here and maybe some important parts of the code where an error could be found like the main function

zeroliken 79 Nearly a Posting Virtuoso

You could simply print out the current array after a swapping is done

zeroliken 79 Nearly a Posting Virtuoso

Did you check the security tab in the properties of the folder to see if you have full control over it or the account your using has a permission to it

zeroliken 79 Nearly a Posting Virtuoso

But what if I want to display or print the passes that happened during the loop

you could print out the variable you need to display before passing it to a function or doing something to it

other than that if you need something else entirely then could you post a sample code of what you need so I can understand it better

zeroliken 79 Nearly a Posting Virtuoso

and plugged it in the fgets parameter and it worked...now my problem is how to get the file size

I Doubt you need the actual file size for reading every line just make sure that the array size and number of char to be read by fgets is enough for every line

zeroliken 79 Nearly a Posting Virtuoso

I have a problem. If the text is too long in the text file...the program crashes. How to solve it?

IF the texts inside the text file are within the number of characters to be read in fgets() and is within the length of the array then this is not the problem,

I am storing the strings (spaces included)

it's already being stored in the string search (line by line with space included)

moreover I cannot reproduce the same problem ,could you post a sample output of the program

zeroliken 79 Nearly a Posting Virtuoso

how did you read the text could you post the code here?

zeroliken 79 Nearly a Posting Virtuoso

It can read the first line just fine
quick question why are you using fgets twice?

zeroliken 79 Nearly a Posting Virtuoso

@line 40
pass the array like this:

BubbleSort(arr, num);

@line 41
are you trying to print the whole array? you could use a loop for that

zeroliken 79 Nearly a Posting Virtuoso

use a FILE pointer which will let the program keep track of the file being accessed
for example it's

FILE *pFile;

but I can't seem to check if this code is correct since I can't compile it well.

if you can't compile it well isn't that a sign that there's something wrong already :)

zeroliken 79 Nearly a Posting Virtuoso

oh, right sorry didn't notice

zeroliken 79 Nearly a Posting Virtuoso

the constructor and methods should look a little like this

public class find {
    int[] array;

    public find(int[] array){
    }

    public int findmax(){
    ...
    return max; 
    }

    public int findmin(){
    ...
    return min;
    }
}
zeroliken 79 Nearly a Posting Virtuoso

it's gonna be hard to tell which part of the code shows where the multiplication has gone awry
could you post the current output and then post what it should look like

zeroliken 79 Nearly a Posting Virtuoso

and after would be collision detection with the platforms when it detects the position of a platform it should stop the downward motion

a good example for this is a mario game
though deprecated here's a good example/tutorial I used as a base for my game a long time ago
http://www.javacooperation.gmxhome.de/PlatformGameBasicsEng.html

zeroliken 79 Nearly a Posting Virtuoso

weird I tried the whole code myself with the corrections I mentioned and got the 15 with all the correct answers...

I think you should try what Adak suggested :)

zeroliken 79 Nearly a Posting Virtuoso

The problem isn't the first letter of the string
your comparing the null terminator of both strings which is equal

@line 6 remove the +1 from strlen
@line 13 change the condition to count<length (compare only the last letter value)

zeroliken 79 Nearly a Posting Virtuoso

did you try it with every variable present there?

zeroliken 79 Nearly a Posting Virtuoso

My guess is, it is most probably the way it reads the file
print out those variable's value to see if it does take a character so you can see when and how it happens

zeroliken 79 Nearly a Posting Virtuoso

I mean when I run the program with my input file of test values.
It's supposed to display numbers. some do, but the b statements display nan..

try do debug it check the values (print them out so you can see) of the variables used when it passes the b conditional to see which causes the problem

zeroliken 79 Nearly a Posting Virtuoso

It's just coming up as nan when I use it in this program

weird it always prints out a numeric value in my end?...
what's the value of term that you input?