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 |
Is the exit() function same as the return statement? Explain.
0 Answers Agilent, ZS Associates,
Who invented b language?
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<=
Design a program which assigns values to the array temperature. The program should then display the array with appropriate column and row headings.
What is structure padding in c?
How can you pass an array to a function by value?
what are the 10 different models of writing an addition program in C language?
How can I get the current date or time of day in a c program?
How can we see the Expanded source code and compiled code for our source program in C?
explain what is a newline escape sequence?
write a c program for swapping two strings using pointer
Explain data types & how many data types supported by c?