write the program for prime numbers?
Answer Posted / arfu
#include<stdio.h>
int main()
{
int c,i,n;
c=0;
scanf("%d",&a);
for(i=2;i<a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1)`("prime");
else printf ("not a prime");
}
Is This Answer Correct ? | 110 Yes | 89 No |
Post New Answer View All Answers
What tq means in chat?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
How does pointer work in c?
What is meant by operator precedence?
What is an lvalue in c?
Explain what is the difference between functions abs() and fabs()?
What is this infamous null pointer, anyway?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What are the different data types in C?
Why & is used in scanf in c?
Explain can static variables be declared in a header file?
What are the header files used in c language?
What is bash c?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff