write the program for prime numbers?
Answer Posted / pritam neogi
#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 ? | 32 Yes | 16 No |
Post New Answer View All Answers
Explain enumerated types in c language?
Who invented bcpl language?
Can the sizeof operator be used to tell the size of an array passed to a function?
How can I do graphics in c?
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What is an arrays?
Write a program to check armstrong number in c?
Why n++ execute faster than n+1 ?
Is r written in c?
Is exit(status) truly equivalent to returning the same status from main?
Is python a c language?
Explain what is a const pointer?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
What is the stack in c?
What is meant by recursion?