write the program for prime numbers?
Answer Posted / sachin 12
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i=2,f=0,j;
printf("\n enter any number");
scanf("%d",&num);
a=num;
while(i<num)
{
if(num%i==0)
{
f=1
break;
}
i++;
}
if(f==i)
{
printf("\n the number is not prime");
}
else
{
printf(""\n the number is prime");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What are the properties of union in c?
What is typedef?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
What is ## preprocessor operator in c?
What is a newline escape sequence?
In which layer of the network datastructure format change is done
Is exit(status) truly equivalent to returning the same status from main?
What is the concatenation operator?
What are the key features in c programming language?
What is pre-emptive data structure and explain it with example?
Why c is a procedural language?
what is the difference between class and unio?
Write a program to reverse a linked list in c.
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above