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

What is else if ladder?

962


What are different types of pointers?

1011


Explain what are the different file extensions involved when programming in c?

1051


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1089


What is the purpose of main( ) in c language?

1088


What is assignment operator?

997


Can a function argument have default value?

1091


Are bit fields portable?

1107


What is the default value of local and global variables in c?

982


What is the meaning of typedef struct in c?

1001


pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2275


Why main is not a keyword in c?

1172


How can you determine the size of an allocated portion of memory?

1236


What is the use of getch ()?

1034


Write a program which returns the first non repetitive character in the string?

1053