write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / santhi perumal
#include<Stdio.h>
#include<conio.h>
int main()
{
int i,j, flag = 0;
for(i=2;i<=100;i++)
{
for(j=2;j<i;j++)
{
if(i != j)
{
if(i%j != 0)
continue;
else
break;
}
}
if(i == j)
printf("%d ",i);
}
}
| Is This Answer Correct ? | 52 Yes | 38 No |
Post New Answer View All Answers
How do I read the arrow keys? What about function keys?
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
What is the use of bitwise operator?
what is event driven software and what is procedural driven software?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Do you know the purpose of 'register' keyword?
Is there any data type in c with variable size?
What is #include cctype?
What are the various types of control structures in programming?
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
What is structure padding in c?
How can I call a function with an argument list built up at run time?
what value is returned to operating system after program execution?
What is typedef struct in c?
What are near, far and huge pointers?