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 the following outputs using for loops
$ $ $ $ $
$ $ $ $
$ $ $
$ $
$

Answers were Sorted based on User's Feedback



. Write a program to print the following outputs using for loops $ $ $ $ $ ..

Answer / madhu

namespace Print_
{
class Program
{
static void Main(string[] args)
{

Print pr = new Print();
pr.Print1("6",6);
Console.ReadLine();
}
}
class Print
{

public void Print1(string str, int noPerLine)
{
for (int j = 1; j <= noPerLine; j++)
{
int k = j - 1;
while (k >= 1)
{
Console.Write("$");
k--;
}
Console.WriteLine('\n');
}

Is This Answer Correct ?    2 Yes 2 No

. Write a program to print the following outputs using for loops $ $ $ $ $ ..

Answer / deepa

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int i , j, k;
for (j = 0; j < 5; j++)
{
for (k = 0; k < 5; k++)
{
if(k<j)
Console.Write(" ");
else
Console.Write("$");
}
Console.WriteLine("
");
}

}
}
}

Is This Answer Correct ?    0 Yes 0 No

. Write a program to print the following outputs using for loops $ $ $ $ $ ..

Answer / srinivas munagapati

namespace Print_
{
class Program
{
static void Main(string[] args)
{
Print pr = new Print();
pr.Print1("7",7);
Console.ReadLine();
}
}
class Print
{

public void Print1(string str,int noPerLine)
{
for (int j = 1; j <= noPerLine; j++)
{
int k = j - 1;
while (k >= 1)
{
Console.Write("*");
k--;
}
for (int i = j; i <= noPerLine; i++)
{

Console.Write(str);

}
Console.WriteLine('\n');

}
}
}
}

Is This Answer Correct ?    4 Yes 7 No

Post New Answer

More C Sharp Code Interview Questions

program for addition of fraction(M/N + P/Q = Y/Z)

1 Answers   Mind Tree,


Can you declare an array of mixed Types?

1 Answers   HCL,


how to change password in .net with c # with ado.net and also SQL server 2008 change password

1 Answers  


Code for Reading and writing from a file?

0 Answers   IBM, Xoriant,


How to Create Files by Using the FileInfo Class?

1 Answers  


Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik

1 Answers   Mind Tree,


Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#

1 Answers  


Code for Working with Files under a Directory?

1 Answers  


Code for IP Address Comparison and Conversion in C#?

0 Answers  


How to find No of classes,Packages,No of Methods per Classes and Depth of Inheritance for selecting source code in windows form application using c# .net? (Source code is input Program. It may be Java or .net) Please help me..) Thanks..)

0 Answers  


Write a program to count 3Letter, 4Letter and 5Letter words from a file and print the number of 3Letter, 4Letter and 5Letter words. Delimiter is space, tab, hifen. Also we should not consider the line in the file after we encounter # in that line.

0 Answers   Mind Tree,


how to get the table names via c sharp and column names also?

2 Answers   Sify,


Categories
  • ASP.NET Code Interview Questions ASP.NET Code (46)
  • VB.NET Code Interview Questions VB.NET Code (9)
  • C Sharp Code Interview Questions C Sharp Code (51)
  • ADO.NET Code Interview Questions ADO.NET Code (8)