Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / rupamrox
#include<stdio.h>
#include<conio.h>
main()
{
int i,j,prime;
clrscr();
for(i=2;i<20;i++)
{
prime=1;
for(j=2;j<i;j++)
{
if(i%j==0)
prime=0;
}
if(prime==1)
printf("%d",i);
}
getch();
}
| Is This Answer Correct ? | 9 Yes | 7 No |
Post New Answer View All Answers
What is the use of structure padding in c?
Where are c variables stored in memory?
What is malloc return c?
What does the file stdio.h contain?
What are keywords c?
Does c have function or method?
What does it mean when the linker says that _end is undefined?
What is the difference between array and pointer?
How is a structure member accessed?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What is the use of sizeof () in c?
What is external variable in c?
Do character constants represent numerical values?
Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.
Explain the properties of union. What is the size of a union variable