how i m write c program 1.check prime number 2.prime number
series
Answer Posted / sulthan
#include<stdio.h>
void main()
{
int a,i,n=0;
printf("\nEnter the Number");
scanf("%d",&a);
for(i=1;i<=a;i++)
if(a%i==0)
n++;
if(n=2)
printf("Prime")
else
printf("NOT Prime");
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is unary operator?
I have seen function declarations that look like this
What is the explanation for modular programming?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
Why is c called a structured programming language?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
why we wont use '&' sing in aceesing the string using scanf
What is the newline escape sequence?
What is sizeof int?
What are enums in c?
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
Write a program to reverse a given number in c language?
What is main return c?
What is the purpose of main() function?
Explain the difference between call by value and call by reference in c language?