小编Sne*_*pta的帖子

我的C程序没有显示任何错误,但之后它没有运行

这是按下ctrl + f9时没有显示任何错误的程序.它说按任意键继续,我这样做,然后它不运行我使用turbo c ++ 4.0,我已经保存了.c格式的文件请建议我应该做的更改来执行我的程序.

谢谢

# include <stdio.h>
# include <conio.h>

float main()
    {
    float l,b,r;
    float circ,area,arsq,peri;
    clrscr ();
    printf ("Enter the length of the rectangle: ");
    scanf ("%f", l);
    printf ("\nEnter the breadth of the rectangle: ");
    scanf ("%f", b);
    printf ("\nEnter the radius of the circle: ");
    scanf ("%f", r);
    peri = l+b+l+b;
    area = 3.14*r*r;
    arsq = l*b;
    circ = 3.14*2*r;

    printf ("\n\nThe perimeter of the rectangle is: %f",peri);
    printf ("\n\nThe area of the …
Run Code Online (Sandbox Code Playgroud)

c

0
推荐指数
1
解决办法
3680
查看次数

如何解决"预期"; 在C中的'{'token'之前?

我创建了一个打印罗马相当于一年的程序,但是我的程序显示了一个编译错误.我的节目说:

33 4 C:\ Users\ABC\Desktop\cc [Error] expected';' 在'{'之前

这是我的代码:

#include<stdio.h>
main()
{
    int a,rom;
    printf("Enter the year.");
    scanf("%d",&a);
    rom=reverse(a);
    printf("Roman equivalent of %d is:",a);
}
reverse(int a)
{
    int i,rev=0,rem;
    for(i=a;i>0;i=i/10)
    {
        rem=i%10;
        rev=rev*10+rem;
    }
    roman(a);
}
roman(int a)
{
    int c=0,i,j,k,l,m;
    for(i=a;i>0;i=i/10)
    {
        m=i%10;
        for(j=1;j>0;j--)
        {
            if(c==0)
            {
                printf("m\n");
            }
            elseif(c==1)
            {
                printf("d\n");
                for(l=m-5;l>0;l--)
                    printf("c");
                printf("\n");
            }
            elseif(c==2)
            {
                printf("l\n");
                for(l=m-5;l>0;l--)
                {
                    printf("x");
                }
                printf("\n");
            }
            elseif(c==3)
            {
                printf("v\n");
                for(l=m-5;l>0;l--)
                {
                    printf("i");
                }
                printf("\n");
            }
        }
        c++;
    }
}
Run Code Online (Sandbox Code Playgroud)

c compiler-errors compilation runtime-compilation

-4
推荐指数
1
解决办法
1972
查看次数