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 / sureshbobra

#include<stdio.h>
#include<conio.h>
main()
{
int flag,i,j;
clrscr();
for(i=1;i<=100;i++)
{
flag=0;
for(j=2;j<=i;j++)
{
if(i%j==0)
{
flag++;
}
}
if(flag==1)
printf("%d\t",i);
}
getch();
}

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a union?

989


How are structure passing and returning implemented?

985


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1334


Explain logical errors? Compare with syntax errors.

1011


What does sizeof function do?

1126


A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles

1119


Write a program to swap two numbers without using third variable?

1247


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4622


a c code by using memory allocation for add ,multiply of sprase matrixes

2744


How can my program discover the complete pathname to the executable from which it was invoked?

1034


Is malloc memset faster than calloc?

1016


Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?

1018


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

1054


What is a pointer in c?

1418


Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)

1217