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 |
How will you find a duplicate number in a array without negating the nos ?
What type is sizeof?
what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it
who is the father of c
How to implement call back functions ?
How many types of operators are there in c?
What are the languages are portable and platform independent?Why they are like that?
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=
What are the two types of functions in c?
Write down the program to sort the array.
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,