write the program for prime numbers?
Answer Posted / harpreet dhillon
#include<stdio.h> \\harpreetdhillon7@gmail.com
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("enter any number which you want to check");
scanf("%d",&n);
for(i=2;i<=n-1;i++)
{
if(n%i==0)
{
printf("not a prime number\n");
break;
}
else
{
printf("prime number\n");
break;
}
}
Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the difference between procedural and declarative language?
What is a char c?
An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
What is actual argument?
Is it better to use malloc() or calloc()?
Explain what is the benefit of using an enum rather than a #define constant?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is the difference between malloc() and calloc() function in c language?
what is event driven software and what is procedural driven software?
List out few of the applications that make use of Multilinked Structures?
Why cant I open a file by its explicit path?
What is the meaning of typedef struct in c?
Difference between MAC vs. IP Addressing
What are the different types of pointers used in c language?