how can write all 1to 100 prime numbers using for loop,if and
break ?
Answers were Sorted based on User's Feedback
Answer / sandeep
#include<stdio.h>
main()
{
int a=2;
work:
printf("%d",a);
a=a+2;
check:
if(a<=100)
goto work;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / divyanshu
#include<iostream.h>
#incude<conio.h>
int main()
{
int x=100,i,p=1;
cout<<"enter the no.";
cin>>x;
for(i=2;i<x;i++)
{
if(x%i==0)
{
p=2;
break;
}
if(x==1)
{
cout<<"prime no.";
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 12 No |
What is difference between constant pointer and constant variable?
What is structure and union in c?
what is difference between array of characters and string
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
How to write a program to receive an integer & find its octal equivalent by using for loop?
Which of these functions is safer to use : fgets(), gets()? Why?
Explain the Difference between the New and Malloc keyword.
Why use int main instead of void main?
What does sizeof return c?
what is compiler
what is void pointer?
Which is an example of a structural homology?