write the program for prime numbers?
Answer Posted / pritam neogi
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i,count=0;
clrscr();
printf("enter the no");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
if(no%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("this is prime no");
}
else
{
printf("this is not prime");
}
getch();
}
Is This Answer Correct ? | 32 Yes | 16 No |
Post New Answer View All Answers
What are the types of pointers?
What are the advantage of c language?
Is fortran still used in 2018?
What is difference between class and structure?
why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above
Is return a keyword in c?
What is structure in c explain with example?
what is bit rate & baud rate? plz give wave forms
Why do we need arrays in c?
write a program to concatenation the string using switch case?
What is c definition?
write a program for the normal snake games find in most of the mobiles.
What is the difference between local variable and global variable in c?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.