This is literally my first lines of code in C, so it's really basic.
The code is this:
#include<stdio.h>
int main()
{
int l, b, ar, pr;
printf("Enter the length of the rectangle");
scanf("%d", l);
printf("Enter the breadth of the rectangle");
scanf("%d", b);
ar = l * b;
pr = 2 * (l + b);
printf("\n Area of Rectangle is: %d", ar);
printf("\n Perimeter of Rectangle is: %d", pr);
}
It starts running properly, outputs "Enter the length of the rectangle", but when I input a number, it just stops and I don't get to input the second value.
What am I missing?
scanfso it can fill it with the input:scanf("%d", l);,scanf("%d", &b);. OT: Don't uselas a variable name as it can be confused withIor1