answersLogoWhite

0


Best Answer

#include #includevoid main() int prime(int num) { inti,flag; for(i=2;iif(num%i!=0) flag=1; else { flag=0; break; } } if(flag == 1 || num == 2) return(1); else return(0); }

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to Print pyramid of prime numbers using loops in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Math & Arithmetic

Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


How do you write a program in java to read ten numbers and print sum of ten integers?

Add the numbers into one variable as you read them in. But if you prefer, you can read the numbers into an array and then use a loop to add the numbers together.


Write a program to print first 100 alternative prime numbers?

This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.


Program for print prime all number from 1 to 100 in foxpro?

Oh, what a lovely request! In FoxPro, you can create a program to print all prime numbers from 1 to 100 by using a loop to check each number for divisibility only by 1 and itself. If it meets this criteria, you can print it out on the screen. Remember, every number is unique and special, just like a happy little tree in a vast forest.


Write a c program to print the following pyramid 1 121 1231 12321 1234321?

To print the given pyramid pattern in C, you can use nested loops. The outer loop controls the rows, and the inner loop controls the numbers to be printed in each row. Here's a simple C program to achieve this: #include <stdio.h> int main() { int rows = 5; for (int i = 1; i <= rows; i++) { for (int j = 1; j <= i; j++) { printf("%d", j); } for (int j = i - 1; j >= 1; j--) { printf("%d", j); } printf("\n"); } return 0; } This program will output the desired pyramid pattern.

Related questions

Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Write a program to Print pyramid of numbers using java?

hi question is here, 1 1 2 1 2 3 1 2 3 4


Q2 Write a program to print even numbers between 10 and 50?

You can use int i; for (i = 10; i <= 50; i += 2) {//print i} as a program to print even numbers between 10 and 50.


Write a C Program to print sum of squares of odd numbers?

#include


How do you write a Qbasic program to display these Numbers-0112358132134?

you do this 10 print "0112358132134" use the whole of the thing


Write an assembly language program to print a to z on screen?

write a program to print A to Z on screen in c?


Write a c program to print the 100 to 1 nos?

Write a c program to print the 100 to 1 nos


How do you write a program to print numbers from star one and next line star two in php?

Try the triangle program on a search engine. Replace numbers with stars and that should do the trick


Write a unix program to print print a pattern?

echo 'print a pattern'


Write the program in qbasic and add two numbers?

Cls input "enter two no.s ",a,b sum=a+b print "sum = ";sum end


How do you write a vb script code to print a pyramid of numbers?

Dont know pyramid but I have code for writting a Triangle- For i=1 to 5 For j=1 to i var= var& " *" Next var=var & vbnewline Next Msgbox var


How do you Write a C program to print a Series of Odd Numbers and Even Numbers.?

Reference:http:cprogramming-bd.com/c_page2.aspx# strange number