Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write a program to print prime nums from 1-20 using c
programing?

Answer Posted / aniruddha tripathi

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int n,m,i;
clrscr();
printf("\n ENTER THE NUMBER");
scanf("%d",&n);
i=2;
ab:mfmod(n,i);
if(m==0);
{
printf("\n it is not prime");
goto bc;
]
else
{
i=i+1;
if(i<=(n-1))
{
goto ab;
}
printf("\n it is a prime no.");
}
bc;
getch();
}

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I read data from data files with particular formats?

1003


All technical questions

1922


What is the difference between %d and %i?

1043


What is the use of bit field?

1117


1) write a program to generate 1st n fibonacci prime numbers using Nested if 2) write a program to generate twin prime numbers from m to n using nested if 3) write a program to check whether a given integer is a strong number or not using nested if 4) Write a program to generate prime factors of a given integer using nested if 5)write a program to generate prime numbers from m to n using nested if 6)write a program to generate perfect numbers from m to n using nested if 7)write a program to generate the pallindromes from m to n using neste if 8)write a program to generate armstrong numbers from m to n using nested if 9)write a program to generate strong numbers from m to n using nested if

4539


Explain what is the difference between functions getch() and getche()?

990


Explain the advantages and disadvantages of macros.

1035


Here is a good puzzle: how do you write a program which produces its own source code as output?

1036


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1667


Can you please explain the scope of static variables?

998


Why functions are used in c?

1070


How can you tell whether two strings are the same?

1204


How can I insert or delete a line (or record) in the middle of a file?

977


about c language

1961


What is the size of a union variable?

1000