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
Why can’t constant values be used to define an array’s initial size?
How does free() know explain how much memory to release?
Explain is it better to bitshift a value than to multiply by 2?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
Explain what is the difference between null and nul?
what is uses of .net
How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?
What is the difference between scanf and fscanf?
What is a double c?
Write program to remove duplicate in an array?
Explain about the functions strcat() and strcmp()?
What is variable declaration and definition in c?
hi, which software companys will take,if d candidate's % is jst 55%?
How to write a code for implementing my own printf() and
scanf().... Please hep me in this... I need a guidance...
Can you give an coding for c... Please also explain about
the header files used other than #include