From the menu bar, click File > New > Project. In the Select a wizard window, expand C/C++, select C++ Project, and then click Next. In the Create a C++ Project window, in the Project name field, enter a name for the C++ project. From the Project type list, select Makefile Project/Empty Project, and then click Finish.
It was mainly developed as a system programming language to write an operating system. The main features of the C language include low-level memory access, a simple set of keywords, and a clean style, these features make C language suitable for system programmings like an operating system or compiler development.
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main() {
int number, guess, nguesses=1;
srand(time(0));
number = rand()%100+1;//Generates random number between 1 and 100.
printf("The number is %d", number);
//keep running the loop until the number is guessed.
do
{
printf("guess the number between 1 to 100\n");
scanf("%d", &guess);
if(guess>number){
printf("Lower number please\n");
}
else if(guess<number){
printf("higher number please\n");
}
else{
printf("You guessed it in %d attempts\n", nguesses);
}
nguesses++;
} while (guess!=number);
return 0;
}