Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Here is a neat trick for checking whether two strings are equal

1018


What are the different types of objects used in c?

1026


In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

1511


how is the examination pattern?

2018


What is the difference between typedef and #define?

1055


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?

2543


What is difference between union and structure in c?

1159


What is variable and explain rules to declare variable in c?

1087


Give differences between - new and malloc() , delete and free() ?

1096


Is main a keyword in c?

1132


Why is c called a mid-level programming language?

1199


What are the storage classes in C?

1159


What is union and structure?

1118


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

3065


With the help of using classes, write a program to add two numbers.

1035