. Write a program to print the following outputs using for loops
$ $ $ $ $
$ $ $ $
$ $ $
$ $
$
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
. Write a program to print the following outputs using for loops $ $ $ $ $ $ $ $ $ $ $ $ $ $ $
program to reverse the order of digits in a given number of any length.
Write a program to count the number of characters, number of words, number of line in file.
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
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.
Write a program to input an integer and - display the reverse - display the sum of each digit - should include logic that considers the input number as any number of digits long
Hello Sir, Thanks for the Solution but, can you pls. Explain the coding for the Static Function & static variable from the below coding....waiting for Ans. class fact { public static void Main() { fact f=new fact(); int x=1; //Declaration of x as 1 int k=Convert.ToInt32(Console.ReadLine()); for(int i=1;i<=k;i++) { x= x *i; } System.Console.WriteLine(x); } }
Write a program which has a function and that function should take 2 or 3 or any number of strings and it should return the largest common prefix of all those strings. If there is no common prefix it should return an empty string. for eg:- INPUT OUTPUT glo {glory,glorious,glod} gl {glad,glow} {calendar,phone} empty string
Code for Reading and writing from a file in c#?
Give the code for Handling Mouse Events?
Code for Working with Files under a Directory?
How to pass multiple rows from one gridview to another gridview after clicking the checkbox.