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 / r@m$

#include<stdio.h>
void main(){
int x;
for(x=2;x<=20;x++){
if(x<4)
printf("%d\t",x);
else
if(x%2!=0 && x%3!=0)
printf("%d\t",x);
}
}

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is it important to memset a variable, immediately after allocating memory to it ?

2021


Why static variable is used in c?

998


Explain what is the benefit of using #define to declare a constant?

1124


What is scope of variable in c?

1011


How can I swap two values without using a temporary?

1077


What does volatile do?

949


Which header file is used for clrscr?

1020


What is a pragma?

1091


How can I trap or ignore keyboard interrupts like control-c?

1035


When should volatile modifier be used?

971


Who is the founder of c language?

1130


What is the c value paradox and how is it explained?

1008


How can you increase the allowable number of simultaneously open files?

1102


How can I find the modification date and time of a file?

1052


How many types of errors are there in c language? Explain

946