Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C
#include<stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
int.const M=10;
int M[N][N4];
int i,j,a,k,m,n;
{
    printf("Avtor:Hristo Rumenov Hristo\n");
    printf("fak.nomer_391217178,grupa_24,kurs_1\n");
    printf("Da se sustavi programa za onrabotka na masiva M[N,N4] sustaven ot celi chissla v intervala [0;999]\n");
    printf("vuvejdane na vhodnite danni:\n");
    printf("vuvedete broi redove i n=");
    scanf("%d", &n );
    printf("vuvedete broi koloni j k=");
    scanf("%d", &k );
    for(i=0,i<n,i++)
    for(j=0,j<k,j++)
    {
                    do
                    {
                          printf("vuvedete M[%d][%d]:",i,j);
                          scanf("%d",& M[i][j]);
                          while (((M[i][j])<0) ²² ((M[i][j])>999));
                      }
                  }
						  printf("izvejdane na vhodnite danni \n");
                          for(i=o;i<n,i++)
                          {
						  for(j=0,j<n,j++)
                          printf("%d  ",M[i][j]);
                          printf("\n")
                     printf("masiva sled sortirane \n");

    for (i = 0; i < m; ++i)

    {

        for (j = 0; j < n; ++j)

        {

            for (k =(j + 1); k < n; ++k)

            {

                if (M[i][j] > M[i][k])

                {

                    a = M[i][j];

                    M[i][j] = array1[i][k];

                    M[i][k] = a;

                }

            }

        }

    }

    for (i = 0; i < m; ++i)

    {

        for (j = 0; j < n; ++j)

        {

            printf(" %d", M[i][j]);

        }

        printf("\n");
    retur 0:
}

can someone help me fix these errors please
24[Error] stray '\262' in program
24[Error] stray '\262' in program
5[Error] expected initializer before 'int'
6[Error] 'N' was not declared in this scope
6[Error] 'N' was not declared in this scope
8[Error] expected unqualified-id before '{' token


What I have tried:


please help me fix this.I just dont understand where i am wrong wth this code
Posted
Updated 12-Nov-17 21:59pm
v2

Quote:
24[Error] stray '\262' in program

May be "²²" is not what it should!
C++
while (((M[i][j])<0) ²² ((M[i][j])>999));

But since the loop does nothing, why do you have a loop at all?
 
Share this answer
 
v2
This is not valid C code:
int main()
int.const M=10;
int M[N][N4];
int i,j,a,k,m,n;
{

It must be something like
/* N and N4 are undefined: Solve errors 6 */
#define N some_int_here
#define N4 (4 * (N))) /* Or some other int */

int main()
/* The function body begins here: Solves errors 5 and 8 */
{
/* int.const is not valid C. 
If it would be or you use
const int M = 10;
the next line would contain a redefinition of M
*/
/* int.const M=10; */
int M[N][N4];
int i,j,a,k,m,n;

Errors 24 are sourced by invalid characters
while (((M[i][j])<0) ²² ((M[i][j])>999));
It should be probably a boolean operation like && or ||.

A tip:
The numbers from the error messages indicate the line number. So most of the errors are easy to spot.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900