Write a program to print prime nums from 1-20 using c
programing?

Answer Posted / aniruddha tripathi

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,m,i;
clrscr();
printf("\n ENTER THE NUMBER");
scanf("%d",&n);
i=2;
ab:mfmod(n,i);
if(m==0);
{
printf("\n it is not prime");
goto bc;
]
else
{
i=i+1;
if(i<=(n-1))
{
goto ab;
}
printf("\n it is a prime no.");
}
bc;
getch();
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write an algorithm to display a square matrix.

2291


How can I remove the trailing spaces from a string?

671


What are lookup tables in c?

617


What kind of structure is a house?

623


What is the usage of the pointer in c?

676






What are the general description for loop statement and available loop types in c?

746


What is a const pointer?

694


What is #error and use of it?

749


What is the significance of scope resolution operator?

940


Is stack a keyword in c?

707


What is line in c preprocessor?

681


Is malloc memset faster than calloc?

687


Where are c variables stored in memory?

651


Why does this code crash?

683


find out largest elemant of diagonalmatrix

1727