Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

I'm new with program soo, pls help

+5 votes
asked Oct 26, 2021 by ZERORT (170 points)

// cuadrado
int Cuadro;
int Opc;
int ResulC;

// triangulo

int base;
int altura;
int Opc2;
int resultado;
int ladoT1;
int ladoT2;

// Opciones

int Opcion1;

// funciones

void funcion_cuadro(void);
void funcion_triangulo(void);

// main

int main()
{
    
    printf("Escoje que figura quieres \nOpcion 1 - Cuadro \nOpcion 2 - triangulo \n ");
    scanf("%d", &Opcion1);
    if( Opcion1 == 1 )
    {
        funcion_cuadro();
    }
    
    if( Opcion1 == 1 )
    {
        funcion_triangulo();
    }
    return 0;
}


// funciones 


void funcion_cuadro(void)
{
    printf("ingresa la medida de un lado del cuadrado\n");
    scanf("%d", &Cuadro);
    printf("Ingresa la opcion deseada \nOpcion1 - perimetro\nOpcion2 - Area\nOpcion3 - volumen\n");
    scanf("%d", &Opc);
    if( Opc2 == 1 )
    {
        printf("escogiste perimetro\n");
        ResulC = Cuadro + Cuadro + Cuadro + Cuadro;
        printf("%d", ResulC);
    }
    if( Opc2 == 2 )
    {
        printf("escogiste Area\n");
        ResulC = Cuadro * Cuadro;
        printf("%d", ResulC);
    }
    if( Opc2 == 3 )
    {
        printf("escogiste volumen\n");
        ResulC = Cuadro * Cuadro * Cuadro;
        printf("%d", ResulC);
    }// fin del if 
}


void funcion_triangulo(void);

{ <== this is error
    printf("ingresa la medida de la base del triangulo: ");
    scanf("%d", &base);
    
    printf("ingresa la altura del triangulo: ");
    scanf("%d", &altura);
    
    printf("Ingresa la medida de cada lado del triangulo por separado (solo para perimetro)");
    scanf("%d", &lado1);
    scanf("%d", &lado2);
    
    printf("ahora debes ingresar que deseas obtener\nOpcion1 - area\nOpcion2 - perimetro\n");
    scanf("%d", &Opc);
    if( Opc == 1 )
    {
        printf("Has escogido area\n");
        resultado = base * altura / 2;
        printf("%d", resultado);
    }
     if( Opc == 2 )
    {
        printf("Has escogido perimetro\n");
        resultado = lado1 + lado2 + base;
        printf("%d", resultado);
    }
}

this is my code

and this is error 

  82 | {
      | ^
see what i mean??? WHAT THE HELL ITS GOING ON?
please help me
idk what its bad on code 
the line error i will put on its marked like this Aa
Code lenguage: C

2 Answers

0 votes
answered Oct 26, 2021 by Peter Minarik (86,040 points)
edited Oct 26, 2021 by Peter Minarik
void funcion_triangulo(void); // Remove the semicolon from the end of the line

Also, you use variables lado1lado2, but you declared them in the beginning as ladoT1 and ladoT2. You should decide which one to use.

Last, but not least, you should include the standard input/output header file:

#include <stdio.h>
0 votes
answered Oct 26, 2021 by Sakib Shahriar (140 points)
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...