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 / faizan n

/*A program to print all primes b\w 1-100*/
#include<stdio.h>
#include<conio.h>

void main()
{
int count,i=1;
int a;
int col=0;
clrscr();

for(i=1; i<101; i++)
{
count=0;
a=1;

while(a<=i)
{
if(i%a==0)
count++;
a++;
}

if(count==2)
{
printf("%d\t",i);
col++;
if(col%10==0)
printf("\n");
}

}
getch();
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it important to memset a variable, immediately after allocating memory to it ?

2070


What is size of union in c?

1021


What is a c token and types of c tokens?

1057


What is the translation phases used in c language?

1124


What is the difference between typedef struct and struct?

1106


count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array

1089


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

2023


In C language, a variable name cannot contain?

1274


What are the preprocessor categories?

1057


How can you determine the size of an allocated portion of memory?

1299


In C programming, what command or code can be used to determine if a number of odd or even?

1054


Is javascript based on c?

1061


Why is c still so popular?

1042


find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2

1989


What are the uses of a pointer?

1151