write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / abhay
#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 ? | 291 Yes | 108 No |
Post New Answer View All Answers
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
Why is c called "mother" language?
Can we change the value of static variable in c?
What do you mean by keywords in c?
If the size of int data type is two bytes, what is the range of signed int data type?
What is the correct declaration of main?
Is int a keyword in c?
When should we use pointers in a c program?
What are the different data types in C?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
Write the syntax and purpose of a switch statement in C.
Explain what does the format %10.2 mean when included in a printf statement?
Is multithreading possible in c?
what are the different storage classes in c?
Write a program that accept anumber in words