write the program for prime numbers?
Answer Posted / samson mugambi
#include<stdio.h>
int main()
{
int c,i,n;
counter=0;
scanf("%d",&a);
for(i=2;i>a;i++)
if (n%i==0)
{
c=1;break;
}
if(c!=1) ("prime");
else print ("not a prime");
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is p in text message?
Can you write a programmer for FACTORIAL using recursion?
Is c procedural or functional?
Write a code to generate a series where the next element is the sum of last k terms.
What is hashing in c language?
Is swift based on c?
Is it possible to initialize a variable at the time it was declared?
The statement, int(*x[]) () what does in indicate?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What is the code in while loop that returns the output of given code?
There seem to be a few missing operators ..
Write a program to reverse a given number in c?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
Explain goto?
What are variables and it what way is it different from constants?