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
How was c created?
Explain what is the difference between a string and an array?
Can the “if” function be used in comparing strings?
What are the 3 types of structures?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What does the message "automatic aggregate intialization is an ansi feature" mean?
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
What do you mean by dynamic memory allocation in c? What functions are used?
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
Why isn't any of this standardized in c? Any real program has to do some of these things.
What is c++ used for today?
How can you convert integers to binary or hexadecimal?
Process by which one bit pattern in to another by bit wise operation is?
What is a static variable in c?
difference between Low, Middle, High Level languages in c ?