c-record - 2) Prime number

 #include<stdio.h>

#include<conio.h>

void main ()

{

int n,i,num_factor=0;

clrscr();

printf("Enter the value N : ");

scanf("%d",&n);

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

    {

if(n%i==0)

num_factor++;

    }

if(num_factor==2)

{

printf("\nPrime number");

} else

{

printf("\nNot a Prime number");

}

getch();

}


note:- write two outputs

1) output:-

alt  +f9   ------   run and

ctrl+f9   ------  compile



2) output:-

alt  +f9   ------   run and

ctrl+f9   ------  compile



Comments

Popular posts from this blog

SOFTWARE

digital marketing ppt-u1

Unit 2: Foundations of Ownership, Security Related Concepts in Blockchain

Unit-1 Foundations of Software Systems and Blockchain

Computer Operations and Performing - D L Unit-1-1

Access the Internet to Browse Infromation & E-Mail Operation- D L Unit-2-1

6)what are the various service of internet and protocols ICT-unit-1

Unit-III: Cascading Style Sheets (CSS) - HTML

MS Word Unit 1-1

Unit-II: HTML Coding Standards & Elements