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
What is a union?
How are structure passing and returning implemented?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Explain logical errors? Compare with syntax errors.
What does sizeof function do?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Write a program to swap two numbers without using third variable?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
a c code by using memory allocation for add ,multiply of sprase matrixes
How can my program discover the complete pathname to the executable from which it was invoked?
Is malloc memset faster than calloc?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
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
What is a pointer in c?
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)