Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / bheem rao
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,count=0;
for(i=2;i<=20;i++)
{
for(j=1;j<=i;i++)
{
if(i%j==0)
count++;
}
if(count==2)
printf("%d\n",i);
count=0;
}
}
Is This Answer Correct ? | 12 Yes | 8 No |
Post New Answer View All Answers
write a program to find the given number is prime or not
Write a code of a general series where the next element is the sum of last k terms.
Explain what is dynamic data structure?
Why clrscr is used in c?
Can you think of a logic behind the game minesweeper.
What is a null string in c?
Difference between macros and inline functions? Can a function be forced as inline?
What is a pointer in c?
When should we use pointers in a c program?
What is 'bus error'?
Explain how do you determine the length of a string value that was stored in a variable?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
What is main () in c language?