write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / nikhil
#include<stdio.h>
#include<conio.h>
void main()
{
int m,flag;
flag=0;
for(int i=2;i<100;i++)
{
for(int j=1;j<i;j++)
{
if(i%j==0)
{flag++;
}
}
if(flag==2)
{printf("it is prime %d",i);
}
}
getch();
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Here is a neat trick for checking whether two strings are equal
What are the different types of objects used in c?
In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping
how is the examination pattern?
What is the difference between typedef and #define?
Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?
What is difference between union and structure in c?
What is variable and explain rules to declare variable in c?
Give differences between - new and malloc() , delete and free() ?
Is main a keyword in c?
Why is c called a mid-level programming language?
What are the storage classes in C?
What is union and structure?
what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555
With the help of using classes, write a program to add two numbers.