write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / siva
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
How do we open a binary file in Read/Write mode in C?
Explain what is output redirection?
How does struct work in c?
What is sizeof array in c?
What is structure and union in c?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?
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]
Explain how many levels deep can include files be nested?
What are the features of c language?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Write a code to generate divisors of an integer?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Which header file should you include if you are to develop a function which can accept variable number of arguments?
What are the types of i/o functions?