write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / shravani
void main()
{
int i,num=1;
clrscr();
while(num<=100)
{ i=2; while(i<=num)
{ if(num%i==0)
break;
i++; }
if(i==num)
printf("\n%d is Prime",num);
num++;
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What are header files and what are its uses in C programming?
How would you rename a function in C?
What is #pragma statements?
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
Explain the use of bit fieild.
How can I implement a delay, or time a users response, with sub-second resolution?
What are the salient features of c languages?
What does node * mean?
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
What is the difference between int main and void main in c?
Explain what are the standard predefined macros?
What is gets() function?
Write a code to generate divisors of an integer?
how to build a exercise findig min number of e heap with list imlemented?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.