May 5, 2011 at 6:29am May 5, 2011 at 6:29am UTC
it should be %s and not %S.
** make it a habit of posting beautiful code so that people like to read the code. Without proper indentation, it becomes hard to point the problems.
it should be something like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
void main ( )
{
int i,j,k, match, ncases;
char *message;
printf ("Enter number of triangle \n" );
scanf (" %d" , &ncases);
/* start loop */
while (ncases)
{
ncases--;
printf ("\nEnter sides of trinagle\n" );
scanf("%d %d %d" , &i, &j, &k);
if ((i>=j+k) || (j>=k+i) || (k>=i+j))
{
message="Not a triangle" ;
}
else
{
match=0;
if (i==j)
{
++match;
}
if (j==k)
{
++match;
}
Last edited on May 5, 2011 at 6:33am May 5, 2011 at 6:33am UTC