write the program for prime numbers?
Answer Posted / samson mugambi
#include<stdio.h>
int main()
{
int c,i,n;
counter=0;
scanf("%d",&a);
for(i=2;i>a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1) ("prime");
else print ("not a prime");
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
plz let me know how to become a telecom protocol tester. thank you.
How can I invoke another program or command and trap its output?
Why static variable is used in c?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
Explain how can you tell whether two strings are the same?
How can I change the size of the dynamically allocated array?
Is null always defined as 0(zero)?
How can you determine the size of an allocated portion of memory?
What are the uses of a pointer?
how to construct a simulator keeping the logical boolean gates in c
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
I need testPalindrome and removeSpace
#include
#include
What is main return c?