Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / ankur mohan sharma
#include<stdio.h>
#include<conio.h>
int main()
{
int i,n;
for(n=2;n<=20;n++)
{
for(i=2;i<n;i++)
{if(n%i==0)
break;}
}
if(i==n)
printf("\n %d",n);
return 0;
}
Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is modeling?
What does %d do?
What are the scope of static variables?
Explain the advantages of using macro in c language?
`write a program to display the recomended action depends on a color of trafic light using nested if statments
What is memcpy() function?
how can I convert a string to a number?
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
Tell me what is null pointer in c?
How many levels of indirection in pointers can you have in a single declaration?
Describe dynamic data structure in c programming language?
What is #define size in c?
What are the benefits of organizational structure?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
When should a far pointer be used?