write the program for prime numbers?
Answer Posted / pratibha
#include<stdio.h>
#include<conio.h>
void main()
{
int no,i,count=0;
clrscr();
printf("enter the no");
scanf("%d",&no);
for(i=1;i<=no;i++)
{
if(no%i==0)
{
count=count+1;
}
}
if(count<=2)
{
printf("this is prime no");
}
else
{
printf("this is not prime");
}
getch();
}
| Is This Answer Correct ? | 17 Yes | 14 No |
Post New Answer View All Answers
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Explain function?
Is null a keyword in c?
What are the applications of c language?
Which is the best website to learn c programming?
What are two dimensional arrays alternatively called as?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
Explain how can you check to see whether a symbol is defined?
What is difference between structure and union in c?
List some basic data types in c?
Difference between exit() and _exit() function?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
What is %lu in c?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
how to print the character with maximum occurence and print that number of occurence too in a string given ?