write the program for prime numbers?
Answer Posted / harpreet dhillon
#include<stdio.h> \\harpreetdhillon7@gmail.com
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("enter any number which you want to check");
scanf("%d",&n);
for(i=2;i<=n-1;i++)
{
if(n%i==0)
{
printf("not a prime number\n");
break;
}
else
{
printf("prime number\n");
break;
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the advantage of an array over individual variables?
Why is c faster?
Explain how can I manipulate strings of multibyte characters?
Explain what is the benefit of using #define to declare a constant?
What is self-referential structure in c programming?
Write a program to implement queue.
What are the uses of a pointer?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
Explain the array representation of a binary tree in C.
What does node * mean?
Explain what is a stream?
What is the use of putchar function?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is the heap in c?