C Basics






/*program to display without using semicolon in a C program*/

#include<stdio.h>   /*header files*/
#include<conio.h>
void main()             /*main function*/
{
if(printf("Hai !My name is Thilagaraj ")){}  /*body of function*/
}  /*end of function*/

               /*Program to list the n number of prime number*/

#include<stdio.h>

#include<conio.h>


void main()
{


   int i,j,n,p=0;


   clrscr();


   printf("\nEnter the limit to which the prime no. to be printed"); 


  scanf("%d",&n);


   for(i=2;i<n;i++)
   {
     for(j=1;j<=i;j++)
        {

          if(i%j==0)


            p++;


          if(p>2)


           break;
         }
              if(p==2)


              printf("\n%d",i);
              p=0;
      }

          getch();
  }