Thursday, 27 August 2015

Factorial program in C

Factorial program in C



Code-

#include <stdio.h>
void main()
{
  int i,n,fact=1;

  printf("Enter a natural number to calculate it's factorial\n");
  scanf("%d",&n);

  for (i= 1;i<=n;i++)
    fact=fact*i;

  printf("Factorial of %d=%d\n",n,fact);
 }


How to install C Free 5 professional compiler

C free 5 is a professional C compiler which is better than any other compilers
available for free.It has many features which makes it handy to work on it.
Give it a try..you will love it.
                                               Click here for step by step Video Tutorial
C Free 5 professional

How to make a simple GUESSING GAME in C

Hi friends! So here it is,Our simple Guessing game coded in C language.Copy and paste it then run it and enjoy the game wink emoticonVideo tutorial Link
P.S. - Don't forget to ask doubts in comments.smile emoticon
‪#‎include‬<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
int score=10,guess=101,num;
randomize();
num=random(100);
printf("\nA random no. between 1 and 100 is choosen..guess the
no.- ");
while(1)
{
scanf("%d",&guess);
clrscr();
if(num>guess)
printf("The no. is greater than %d, guess again- ",guess);
if(num<guess)
printf("The no. is smaller than %d, guess again- ",guess);
if(num==guess)
break;
score--;
}
printf("Correct! Your score is %d. Press any key...",score);
getch();
clrscr();
printf("\nFor more cool coding,\n\t\t\tReach our fb page @https://www.facebook.com/coolcoding.org");
getch();

}