write the program for prime numbers?
Answer Posted / karthik
#include<stdio.h>
#include<conio.h>
void main()
{
int n,flag;
clrscr();
printf("\n Enter prime no\n");
scanf("%d",&n);
for(int i=2;i<=n/2;i++)
{
if(n%i==0)
{
flag=0;
break;
}
}
if(flag==0)
printf("\n%d is not prime",n);
else
printf("\n %d is prime",n);
getch();
}
| Is This Answer Correct ? | 21 Yes | 17 No |
Post New Answer View All Answers
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
Differentiate between the = symbol and == symbol?
how many key words availabel in c a) 28 b) 31 c) 32
What is c value paradox explain?
What are pointers in C? Give an example where to illustrate their significance.
What does the message "automatic aggregate intialization is an ansi feature" mean?
What are the advantages and disadvantages of a heap?
What is the use of pointers in C?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
Is stack a keyword in c?
With the help of using classes, write a program to add two numbers.
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none
What is integer constants?
i have a written test for microland please give me test pattern
i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....