Hello,
I am fairly new to c and i am finding it hard to spot why a part of a program I am making is not working. The program lets you work out the area and circumference of a circle. This is the code:
#include <stdio.h>
#include <math.h>
int area() ;
int circ() ;
int main()
{
char choice ;
printf("\n Do you want circumference(c) or area(a): ") ;
scanf("%c" , &choice ) ;
if(choice = 'c') { int circ() ; }
if(choice = 'a') { int area() ; }
else { int main() ; }
return 0 ;
}
int area()
{
float radius , pi = 3.141592 ;
printf( "What is the radius: ") ;
scanf( "%f" , &radius ) ;
printf( "\n The Area is %f \n" , pi*(radius*radius) ) ;
return 0 ;
}
The issue is that after i type a letter in for the first input, it stops runninig the program. The compiler that I am using (cygwin) did not give me any errors.I have not finished yet.
Thank you