Beruflich Dokumente
Kultur Dokumente
#include<stdio.h>
void main()
{
int count=0,a;
printf("Enter Number\n");
scanf("%d",&a);
for(int i=1;i<=10;i++)
{
if(i==1||i==a)
{
}
else if(a%i==0)
{
count++;
}
else
{}
}
if(count>=1)
printf("Not a Prime\n");
else
printf("Prime\n");
}
Output:
dinesh@dinesh-HP-15-Notebook-PC:~/C Pgms$ ./a.out
Enter Number
5
Prime
Linked List:
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
};
new_node->data = new_data;