Click here to Skip to main content
15,903,770 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
the code is not running
the code is not working
how can i do it

What I have tried:

C
#include<stdio.h>

int main(){
    int length, breadth;
    printf("What is the length of the rectangle\n");
    scanf("%d", &length);

     printf("What is the breadth of the rectangle\n");
     scanf("%d", &breadth);

     printf("The area if your rectangle is %d", length*breadth);
    return 0;
}
Posted
Updated 30-Nov-21 3:26am
v2
Comments
Richard Deeming 30-Nov-21 4:24am    
Despite the similar names, C and C# are completely different languages. You have tagged your question as "C#", but the question title and code says you're using "C".
PIEBALDconsult 30-Nov-21 9:26am    
(Fixed.)

1 solution

Quote:
the code is not running
the code is not working
how can i do it
If I copy'n'paste your code into an online C compiler (Online C Compiler - online editor[^]) it compiles cleanly, runs, and does exactly what I expect:
What is the length of the rectangle
21
What is the breadth of the rectangle
42
The area if your rectangle is 882

...Program finished with exit code 0
Press ENTER to exit console.

So the code does run, the code does work - I'd suggest that it's "finger trouble" at your end which obviously we can't see or help with: I'd suggest that you go back to yoru basic instructions on how to compile the code, and double check that to make sure it has been compiled correctly, linked correctly, and that there are no errors. Then check your instructions on how to run the EXE file that compilation and linking produced.

Sorry, but we can't help you with that - we have no access to your system at all!
 
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