Write a program to print prime nums from 1-20 using c
programing?
Answer Posted / dinesh
#include<stdio.h>
main()
{
int i,j;
for(i=2;i<=20;i++)
{
c=1;
for(j=2;j<i;j++)
{
if(i%j==0)
c=0;
}
if(c==1)
printf("%d",i);
}
}
| Is This Answer Correct ? | 46 Yes | 21 No |
Post New Answer View All Answers
Mention four important string handling functions in c languages .
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What are the different categories of functions in c?
What is a pragma?
Do you know the use of fflush() function?
What is the sizeof () operator?
write a program to find the given number is prime or not
How can I sort a linked list?
How can you draw circles in C?
How many bytes are occupied by near, far and huge pointers (dos)?
Explain what is the advantage of a random access file?
How can a program be made to print the name of a source file where an error occurs?
What is oops c?
What is the function of volatile in c language?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.