Showing posts with label print. Show all posts
Showing posts with label print. Show all posts

PRINT PRIME NUMBERS BETWEEN 1-300 USING BREAK AND CONTINUE IN C

How To PRINT PRIME NUMBERS BETWEEN 1-300 USING BREAK AND CONTINUE IN C Program.


#include <math.h>
#include <stdio.h>
main()
{
  int i, j;
  i = 1;
  while ( i < 300 )
  {
            j = 2;
            while ( j < sqrt(i) )
            {
                        if ( i % j == 0 )
                                    break;
                        else
                        {
                                    ++j;
                                    continue;
                        }
            }
   if ( j > sqrt(i) )
            printf("%d\t", i);
    ++i;
  }
  return 0;
}

Write a c program to print Pascal triangle.

How To Write a c program to print Pascal triangle.



#include<stdio.h>
int main(){
  int line,i,j,k;
  printf("Enter the no. of lines");
  scanf("%d",&line);
  for(i=1;i<=line;i++){
      for(j=1;j<=line-i;j++)
           printf(" ");
      for(k=1;k<i;k++)
      printf("%d",k);
      for(k=i;k>=1;k--)
      printf("%d",k);
      printf("\n");
  }
  return 0;
}

C or C++ Program To Print Prime Number

How to write a C or C++ program to print prime number in C Programming Language ?

This Program print first 50 prime number.

To print first 50 prime number

Solution For C Program:

C Program print fill zero & mod/div

How to write a C Program print fill zero & mod/div in C Programming Language ?


Solution For C Program :

C Program to Print a String Without Use Semicolon.

How to write a C Program to Print a String Without Use Semicolon in C Programming Language ?


Solution For C Program :

/*C Program to Print a String Without Use Semicolon.*/

#include <stdio.h>
#include <conio.h>
void main()
{
 if(printf("Hello"))
}