Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Development-process C Program to Print Stras
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


sushant
C Program to Print Stras
1 Answer(s)      4 years and 9 months ago
Posted in : Development process


How I can Print Following Output using Two For loops in C Language?

*
* *
* * *
* * * *
* * *
* *
*

Advertisement
View Answers

February 18, 2010 at 10:47 AM


Hi Friend,

Try the following:

#include <stdio.h>
#include <conio.h>

void main(){
int i=0;
int j=0;
for(i=1;i<=4;i+=1){
printf("\n");
for(j=1;j<=i;j++)
printf("*");
}
printf("\n");
for(i=3;i>=0;i-=1){
for(j=0;j<i;j++){
printf("*");
}
printf("\n");
}
getch();
}

Thanks


Related Tutorials/Questions & Answers:
C Program to Print Stras - Development process
C Program to Print Stras  How I can Print Following Output using Two For loops in C Language? * * * * * * * * * * * * * * * *  Hi Friend, Try the following: #include #include void main(){ int i=0
C program to print the following
C program to print the following  Hello, Some one help me with a "C Program" to print the following as output: 4444444 4333334..., that is why I choosed Java Beginners, but please give me a C program
Advertisements
write a program in C to print following triangles on the screen
write a program in C to print following triangles on the screen  write a program in C to print following triangles on the screen
write a program to use for loop print **********========== in c language
write a program to use for loop print **********========== in c language  write a program to use for loop print **========== in c language
C Program to Print Following Output - Development process
C Program to Print Following Output  Hello Sir I wnat to print Followning output in C Language with for loop How I Can Print it? 5 5 4 5 4 3 5 4 3 2 5 4 3 2 1  Hi Friend, Try the following: #include
C Program to Print Pascal Triangle - Development process
C Program to Print Pascal Triangle  I want C Program to Print Pascal Triangle.  Hi Friend, Try the following code: #include #include void main(){ int a[15][15],i,j,rows,num=25,k; printf("\n enter
How to print the following output using c program
How to print the following output using c program  1) 4 3 4 2 3 4 1 2 3 4 2) A B C D E F G H I J
Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c
Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c  class rose { int n...); System.out.println("\nReverse the number"+i); S.out(); } }   print
program of c
program of c  write a program in c to display a to z without using printf or scanf statements or header files
c program
c program  plz send me program for this. write a program to print the following code? (in c language) 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10
C program
a function to print names of all students who joined in a particular year. (c)Write a function to print the data of a student whose roll number is given...C program  hi, here is my question: Create a structure to specify
c program
c program  plz send me program for this. write a program to print the following code? 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 11 2 3 4 5 6 7 8 9 10 11 12 3 4
program in c
program in c  Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement. For example: 1 3
c++ program
c++ program  Write a program which reads a text from the keyboard and displays the following information on the screen in two columns: (a) Number of lines (b) Number of words (c) Number of characters Strings should be left
write a program to print
write a program to print   write a program to print following 1 2 3 4 5 4 3 2 1 1 2 3 4 4 3 2 1 1 2 3 3 2 1 1 2 2 1 1 1
program to print total marks
program to print total marks  program to input total marks out of 600 marks as an argument and print the stream allotted using the following criteria 401 & above - PCM 301-400 - ZBC 201-300- Commerce 101-200 - Arts
C Program
C Program  Why doesn't the code int a = 1000, b = 1000; long int c = a * b; work? plz help me sir
c program
c program  WAP to show the area of a perimeter of a rectanglar by using input command
c program
c program  How to convert binary digits to decimal number without using power function
A Program To Print A Equilateral Triangle
A Program To Print A Equilateral Triangle  Write A program to Print Following In Java : 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Print Output in C LAnaguage - Development process
Print Output in C LAnaguage  I want to Print Following Output in C Language with Combined For Loops Not Seprate Loops pleaseHelp Me
Write a program to print using for loop
Write a program to print using for loop  Write a program to print using for loop * * * *  
C program - SQL
C program  write a C program to print multiplication table using pointers.  Hi Friend, Try the following code: #include #include void main() { int i,j; int * pt; clrscr(); printf(" "); printf("\n
method overloading in c program
method overloading in c program  how is method overloading in C program is different from C++ program
about a program in c language
about a program in c language   Write a program that inputs five different integers from the keyboard, then print the sum, the product, the smallest and the largest of these numbers. Use only single selection form of if statement
C program - Java Magazine
C program  develop a simple program in C that allows a user to enter..., the program should print the following; The three integers form a Right-angled... and then the program; a)First determines whether the 3 integers entered represent the sides
malloc in c example program
malloc in c example program  What is malloc in c? Please explain the term using an example in C program. Thanks
C Program with Database Connectivity
C Program with Database Connectivity  How To Connect MySQL Database in C Program with Graphics
c program - Java Beginners
c program  Write a program to encrypt a string and decrypt
C program - SQL
C program  Write a C program for airport simulation using queue data structures. Please reply me
c program - IoC
c program  given the string "wordprocessing",write a program to read the string from the terminal and display the same in the following formats: a) word processing b) word processing c) w.p.
Advertisements
 

 

 

DMCA.com