write the program for prime numbers?
Answer Posted / karthika
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2;
clrscr();
printf("\n entert a number");
scanf("%d",&num);
while(c<=num-1)
{
if(num%i==0)
{
printf("given number is not a prime number\n");
break;
}
i++;
}
if(i==num);
printf(given number is a prime number\n");
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain what’s a signal? Explain what do I use signals for?
Do you know the purpose of 'register' keyword?
What is maximum size of array in c?
What is volatile variable how do you declare it?
How do you declare a variable that will hold string values?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
Write the Program to reverse a string using pointers.
How can I remove the trailing spaces from a string?
What is sizeof in c?
What happens if you free a pointer twice?
What are the benefits of organizational structure?
Explain the difference between the local variable and global variable in c?
What is the difference between void main and main in c?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What is s or c?