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

how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12

664


When should a far pointer be used?

613


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1578


In which header file is the null macro defined?

871


how logic is used

1510






How reliable are floating-point comparisons?

636


what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?

1919


What does 1f stand for?

626


What is the translation phases used in c language?

647


What is a c token and types of c tokens?

600


What does the function toupper() do?

671


What is c programming structure?

631


What is return in c programming?

527


What is a pointer and how it is initialized?

620


Explain how can you determine the size of an allocated portion of memory?

636