[QUOTE=firstPerson;1003579]Why is that again?[/QUOTE]

You see as far as I understand.... the requirement was to put the display in matrix form and you've used ROW and COLUMN as the elements for deciding the matrix display... for a prime sized array this is not gonna work... or will it??:?:

[QUOTE=KimJack;1003652]This is great, but how would I go about preventing duplicates when the array is randomized?[/QUOTE]

What is the basic question that you are asking can you please explain if it is about printing 1D array in 2D format then where does the question comes about randomizing it??:?::-/

[QUOTE=firstPerson;1003276]Yes. In fact thats very common, using 1d array as a mimic of a 2d.

[code]
final int ROW = 5;
final int COL = 5

char[] Letters = new char[ ROW * COL];

for(int i = 0; i < ROW * COL; i++)
Letters[i] = (char)( 'A' + i );

for(int i = 0; i < ROW; i++)
{
for(int j = 0; j < COL; j++)
{
System.out.print( Letters[j + i * ROW] + " " );
}
}
[/code]

It hasn't been tested, but you should get the idea, if it doesn't work.[/QUOTE]

In this there is restriction that the array dimension can't be prime (Not a big deal...HUH??) :yawn:

for prime we can use following looping...
[CODE]
int j=0;
for(int i=0;i<arr.length;i++)
{
while(j%4!=0)
{
System.out.print(arr[j++]+" ");
}
System.out.println(arr[j++]);
}
[/CODE]

I hope this works well and maybe better (LOL :D)
your signature is really good "firstPerson" :)

one 1D array (char type) should do the job... for storing the characters... their indexes will be used in comparing with the value entered by the user. if the character at the indexes (values) enered by the user are same then they will show, otherwise not...
I hope u got my point....

An Indian Buddy...?(of course)

The problem is that you are not getting the value of small as evaluated from the function `findLowest()`.

So, better try this thing...

``````void calcAverage (int average, int score1, int score2, int score3, int score4, int score5)
{
int small=findLowest(score1,score2,score3,score4,score5);
average = ((score1 + score2 + score3 + score4 + score5)-small)/4;
cout << average;
}``````

As suggested by Nichito.

Another point:
Why are you declaring average in main() and then passing as an argument? Just declare it in `calcAverage()` only.

^

Your messaging style is really nice hollystyles.

^
Choose nice words to "Say Something Nice About Others"

^

May be he is having some link with Microsoft as the name suggests.:confused: :confused:

^

^
GOLDeagle2005

As the name suggests must be having some golden qualities(may be unknown to me)

^

The rate of

"Posts per Day"

Is really good.(Wish to have it)

I get the feeling you didn't look very hard. Have you considered recursion? What about goto? Neither of those are considered to be loop constructs.[/QUOTE]

yes...
I tried it and hey tlly i come up with the following code.......
May be this would suit ur expectatios to the best.So, check this out...
:idea: :idea: :idea:

[code]#include<stdio.h>

include<conio.h>

void main()
{
int n;
int prno();
clrscr();
printf("\n Enter the no. upto which u want to print the no.=");
scanf("%d",&n);
n++;
prno(n);
getch();
}
prno(int i);
{
i--;
(i<=0)?printf("\n Thank u") : prno(i);
printf("\n %d",i);
return(i);
} [/code]

Have fun with 'C':) :) :) :!:

[QUOTE=Antonyraj]This is the program without using semicolon. Iam antony from india my mail id <<email snipped>> welcome some more queries.

main()
{
if(printf("Hello World"))
{

}
}[/QUOTE]

Oooooops....
i m a bit late.
Antonyraj put the same code which otherwise i would have done.:) :)
Right now.... trying to solve the other one.
i think functions would be a way to solve it ........???:idea:

Well...
I do not think so...

If there are any stars for negativity, I would rate it last star.
:-|

[QUOTE=jlouang]I don't know if I read the book right but my array is not working on my months .My instructions is

this assignment uses an array of strings:

write a C program that asks the user for the month, day, and year

read in the month, day and year (as ints)

the function header should be void PrintMonth(int month)

the function accepts the month as a parameter and prints out the proper month name

the function does not have to verify a valid date

best approch is to declare an array of 12 strings and initialize the elements of the array with the proper month name

[CODE] /****

• prototypes //declared function so main can find
*****/
void printMonth(int m);

/**
*
***/

char month[13] =
{"January","Febuary","March", "April", "May", "June", "July", "August",
"September", "October", "November", "December"};

int main()
{
int month;
int day;
int year;
cout << "enter the month: ";
cin >> month;
cout << "enter the day: ";
cin >> day;
cout << "enter the \year: ";
cin >> year;
cin.ignore();

cout << month << " " << day << " " << year << "\n";

cin.get();

system("pause");
}
void printMonth(int m)
{
cout << month[m] << "\n";
}
[/CODE][/QUOTE]

:confused:
Cann't understand ur question & the code u hav given.
U r asking for a 'C' program, but i think cin & cout are used in C++
:confused:
Moreover...
U are using char month[13] to store names of 12 months.
but this will store a string of ...

Hmm...I apologize.
Uhh... Don't know what to say,but...
Actually there must be some way for preventing unneccessary posts...or do we have?
:confused:

:?:
OK if i m not puzzeled with this discussion, i would say that a thread starter should have the right to delete a post which he don't like. May be that would be helpful to keep unnecessary posts out of the thread.
:rolleyes: