write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / anshul
#include <stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for (i=1;i<=100;i++)
{
k=0;
for (j=1;j<i;j++)
{
if (i%j==0)
{
k++;
}
}
if(k==2)
{
printf("%d \n",i);
}
}
getch();
}
It displays all prime no. from 1 to 100
commants: er.anshul2009@gmail.com
Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
What is assignment operator?
Does c have class?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is the difference between formatted&unformatted i/o functions?
What are the preprocessor categories?
Explain how can type-insensitive macros be created?
What is sizeof int in c?
What are qualifiers and modifiers c?
What is the difference between text and binary i/o?
write a program to reverse a every alternetive words in a string in a place. EX: Input is "this is the line of text" Output should be "shit is eht line fo text" Please any one tell me code for that.
What are comments and how do you insert it in a C program?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is the difference between functions getch() and getche()?
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 memory leak in c?