Hi.
Its my first post in this forum, along with this, I am also brand new to C language.
I studied little bit if condition and now i reached to loops. So I started loops first.
I have tried a code here:
Code:
#include "stdafx.h"
#include <conio.h>
int main()
{
char a = 'y', store;
printf("Do you have friends, press y for yes and n for no = \n");
scanf("%c", &store);
while (a == store)
{
printf(" Yes I do have friends \n");
break;
}
printf("Loop ended");
getch();
}
What i expect from my code is that as long as the user is pressing 'y' the code will be executing over and over again. As the user presses the 'n' the program will stop executing.