write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / siva
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
#include show(int t,va_list ptr1) { int a,x,i; a=va_arg(ptr1,int) printf(" %d",a) } display(char) { int x; listptr; va_star(otr,s); n=va_arg(ptr,int); show(x,ptr); } main() { display("hello",4,12,13,14,44); }
How can you tell whether a program was compiled using c versus c++?
What is const and volatile in c?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
What is the benefit of using an enum rather than a #define constant?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
Wt are the Buses in C Language
What is the difference between #include and #include 'file' ?
Explain how do you sort filenames in a directory?
Why we use int main and void main?
How to establish connection with oracle database software from c language?
What is the difference between NULL and NUL?
What is array of structure in c programming?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
what is the role you expect in software industry?