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
When should the volatile modifier be used?
Explain high-order bytes.
Define and explain about ! Operator?
How to find a missed value, if you want to store 100 values in a 99 sized array?
For what purpose null pointer used?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
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
application attempts to perform an operation?
Are there constructors in c?
Is there a way to have non-constant case labels (i.e. Ranges or arbitrary expressions)?
How can you call a function, given its name as a string?
What does the function toupper() do?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
Why do we use stdio h and conio h?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures