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
What are the 32 keywords in c?
Explain what are the different data types in c?
Explain how do you print an address?
How are portions of a program disabled in demo versions?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college. 1.write a function to print names of all students who joined in a particular year 2.write a function to print the data of a student whose roll number is given
int main() { Int n=20,i; For(i=0;i<=n;i--) { Printf(“-“); Return 0;
Why header file is used in c?
What is the scope of global variable in c?
What is a volatile keyword in c?
How is = symbol different from == symbol in c programming?
What type is sizeof?
What kind of structure is a house?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
Is array a primitive data type in c?