Learn to indent your code!!!
Code:
#include<stdio.h>
void function1();
void function2();
void main()
{
char variable1;
char repeat;
do
{
printf("Please press 'b' if you wish to do something \n or\n please press 'v' if you wish to do something else ");
scanf("%c",&variable1);
if (variable1=='b')
{
function1();
}
else
{
if (variable1=='v')
{
function2();
}
printf("Do you wish to repeat the program? (y/n)");
scanf("%c",&repeat);
}
while(repeat=='y');
}
void function1()
{
printf("function1 has been utilised");
}
void function2()
{
printf("function2 has been utilised");
}
Code:
Compiling: main.c
H:\SourceCode\Projects\testc\main.c:4:6: warning: return type of 'main' is not 'int' [-Wmain]
H:\SourceCode\Projects\testc\main.c: In function 'main':
H:\SourceCode\Projects\testc\main.c:28:5: error: expected 'while' before 'void'
H:\SourceCode\Projects\testc\main.c:36:5: error: expected declaration or statement at end of input
Tim S.