write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / anshul
#include <stdio.h>
#include<conio.h>
void main()
{
int i,j,k;
for (i=1;i<=100;i++)
{
k=0;
for (j=1;j<i;j++)
{
if (i%j==0)
{
k++;
}
}
if(k==2)
{
printf("%d \n",i);
}
}
getch();
}
It displays all prime no. from 1 to 100
commants: er.anshul2009@gmail.com
| Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Why is main function so important?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
When was c language developed?
All technical questions
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);
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
Define circular linked list.
Explain data types & how many data types supported by c?
In c language can we compile a program without main() function?
What is extern c used for?
Why main function is special give two reasons?
provide an example of the Group by clause, when would you use this clause
What is the difference between variable declaration and variable definition in c?
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
regarding pointers concept