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 the difference between struct and union in C?
Why isn't it being handled properly?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
What are called c variables?
write a program to display all prime numbers
Is it cc or c in a letter?
Explain pointer. What are function pointers in C?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What is far pointer in c?
What is class and object in c?
What 'lex' does?
Is struct oop?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures
How pointer is different from array?
What is #include stdio h and #include conio h?