Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / dinesh
#include<stdio.h>
main()
{
int i,j;
for(i=2;i<=20;i++)
{
c=1;
for(j=2;j<i;j++)
{
if(i%j==0)
c=0;
}
if(c==1)
printf("%d",i);
}
}
| Is This Answer Correct ? | 46 Yes | 21 No |
Post New Answer View All Answers
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters
What is static memory allocation?
What is an arrays?
Why isnt there a numbered, multi-level break statement to break out
How is pointer initialized in c?
What are different types of variables in c?
what is reason of your company position's in india no. 1.
What is a list in c?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
What is a shell structure examples?
If you know then define #pragma?
In which layer of the network datastructure format change is done