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 do you mean by dynamic memory allocation in c? What functions are used?
How many keywords are there in c?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
Do array subscripts always start with zero?
How is actual parameter different from the formal parameter?
Why is struct padding needed?
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is the stack in c?
How variables are declared in c?
Do you know what are the properties of union in c?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
How can I use a preprocessorif expression to ?
What is a macro, and explain how do you use it?
What is the symbol indicated the c-preprocessor?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none