hi, i am new to c have to write a program to check the shape.
I think the error is somewhere at shape= square. I know i can use printf statements but i want it in this format. Can someone help me please?
#include <stdio.h>
int main (void)
{
int length,breadth;
char shape;
printf("Input your length: ");
scanf("%f", &length);
printf("Input your breadth: ");
scanf("%f", &breadth);
if (length=breadth)
{
shape= 'square';
}
else {
shape = 'rectangle'
}
printf(" the length is%d, breadth is %d , hence given shape is %s", length, breadth, shape);