You are on page 1of 108

Upload Pradeep Anjanappa View Public Profile My ContentMy Reading FeedMy Stats MessagesNotificationsAccount | SettingsStore EarningsHelp Log Out

Explore Documents School WorkHealth & MedicineBrochures/CatalogsMagazines/NewspapersHow-To Guides/ManualsRecipes/MenusBooks - FictionBooks - Non-fictionGovernment Docs+ all categories RecentFeatured People AuthorsStudentsResearchersPublishersGovernment & NonprofitsBusinessesMusiciansArtists & DesignersTeachers+ all categories Most FollowedPopular <iframe height="0" src="//www.googletagmanager.com/ns.html?id=GTM-ZWF6" style="display:none;visibility:hidden" width="0"></iframe> < div style="display:none;">< img src="//pixel.quantserve.com/pixel/p-13DPpb-yg8ofc.gif" border="0" height="1" width="1" alt="Quantcast">< /div> Read without ads and support Scribd by becoming a Scribd Premium Reader. See Premium Plans Language: English Download Go BackAdd Note Link Embed Save for later of 69 Readcast Not Readcasted Note: You can always click on the Readcast button to share with your Scribd followers. Auto-Readcasting: OffView Past Readcasts Undo
20ac2c5aa7a723

Add a com

Submit

Auto-Readcasting: OffView Past Readcasts

Chapter # 3
Sr.no

T o p i c D a t e S i g n 1 .

Reading

strings from the keyboard


9

1 2007 2.

Changing

String order
9

2007 3.

More than one class

1 2007 4.

Assigning values to variables


9

1 2007 5.

Diamond

pattern on the console screen

1 2007

Chapter

# 4
Sr.no T o p i c

D a t e S i g n 1 .

Illustrating the Concept

of Declaration of variables
16

1 2007 2.

Declaration

& Additions of variables


16

1 2007 3.

Program

with a function
16

2007 4.

Demonstrat ing Boxing

& Unboxing
16

2007 5.

Demonstrat ing addition of

byte type variables


16

2007 6.

Implementi ng some

custom console output


16

2007 7.

Printing a home

like figure in the console

16

1 2007 8.

Executing some console statements


16

1 2007

Chapt er #

3 (Overv iew

of C#)
3.1


Reading strings from the

keyboard
using System; class Prog3_1 { public

static void Main() { Console.Write ("Enter Your

First Name : "); // Displaying to

write first name string name1 =

Console.ReadLi ne (); // Saving first name

in name1 Console.Write ("Enter Your Last Name

: "); // Displaying to write last

name string name2 = Console.ReadLi ne ();

// Saving first name in name2

Console.WriteLi ne ("Hello Mr." + name1 +"

" + name2); // Displaying both first

& last names Console.ReadLi ne (); //

Since to stop the console for displaying

last line, we use this to accept

a keystroke frm user. (Similar to getch()

in C) }
}

OUTPUT
Enter Your

First Name: Daljit Enter Your Last Name:

Singh Hello Mr. Daljit Singh

3.2


Changing String order
using

System; class Prog3_2 { public static void

Main(String [] args) { Console.Write( args[2] +

args[0] + args[1]); } }

3.3

More than one class

using System; class ClassOne { public void

One() // A function named One {

Console.Write(" C Sharp "); } } class

Mainly { public static void Main() //

A function named Main (Main Function) {

ClassOne demoObj = new ClassOne (); //Creating

ojecct of ClassOne demoObj.One (); // Will

display

> C Sharp Console.Write

("Programming") ; // Will display

>

Programming // Both "C Sharp" & "Programming"

will be displayed in a single line

due to this line

>

Console.Write(" C Sharp "); Console.ReadLi ne ();

} }

OUTPUT
C Sharp Programming

3.4 Assigning values to

variables
using System; class SampleMath { public

static void Main() { double x =

2.0; // declaring a variable named x

of type double & assigning it value

2.0 double y = 3.0; // declaring

a variable named y of type double

& assigning it value 3.0 double z

; // declaring a variable named z

of type double z = x +

y; Console.WriteLi ne("x = " + x

+ ", y = " + y

+ " & z = " +

z); Console.ReadLi ne(); } }

OUTPUT
X

= 2.0, Y = 3.0, Z =

5.0

3.5 Diamond pattern

on the console screen


using

A = System.Console ; class Pattern {

public static void Main() { A.WriteLine ("

X "); A.WriteLine (" XXX "); A.WriteLine

("XXXXX"); A.WriteLine (" XXX "); A.WriteLine ("

X "); A.ReadLine (); } }

OUTPUT

X XX XXX XX X

Chapt er #

4 (Liter als,

Variab les &

Data Types)
Search Search History: Searching... Result 00 of 00 00 results for result for p.

C# Balaguruswamy Solved Programs


C# Solved programs from Balaguruswamy Download or Print Add To Collection 45.2K

Reads 476 Readcasts 1.0K Embed Views

Published by anushreesanikop
20ac2c5aa7a723

Follow

Search TIP Press Ctrl-FF to search anywhere in the document. Read without ads and support Scribd by becoming a Scribd Premium Reader. See Premium Plans

Info and Rating


Category: Uncategorized. Rating: (3 Ratings) Upload Date: 05/20/2009 Copyright: Attribution Non-commercial C# programs Tags: bsc it Free download as PDF File (.pdf), Text File (.txt) or read online for free. Flag document for inapproriate content

Download and print this document


Choose a format to download in

.PDF

.TXT Download Read without ads and support Scribd by becoming a Scribd Premium Reader. See Premium Plans

Recommended

58 p. c# PROGRAM (1) Vijay Nayak 5183 Reads

26 p. simple c programs grsrik 111373 Reads

69 p. C Balaguruswamy Solved Programs Jotiram Redke 628 Reads

1 p. Object Oriented Programming with C++ By E Balagurusamy sushant.gore1434618 81579 Reads Next

More From This User

669 p. Barron GRE 12th Edition anushreesanikop 208 Reads

193 p. Book for Internet Technology anushreesanikop 1721 Reads

124 p. psdc anushreesanikop 8164 Reads

Featured

17 p. Recipes From Asian Tofu TheRecipeClub

32 p. Abide With Me Simon and Schuster

29 p. Execution of Noa P. Singleton Crown Publishing Group

24 p. Childfree by Choice Simon and Schuster Next

Notes

panjanappa_1 Post note Mehul Makwana3 years ago Reply not all programs r der Mehul Makwana3 years ago Reply not all programs r der Mehul Makwana3 years ago Reply

not all programs r der Girjesh K Kumara year ago Reply i love you Girjesh K Kumara year ago Reply i love you Krishna Mandal8 months ago Reply thankx alot for such grt help Krishna Mandal8 months ago Reply thankx alot for such grt help Vijay Dhas8 months ago Reply Where i can get all the programs?? Vijay Dhas8 months ago Reply Where i can get all the programs?? Tahaseen Attar6 months ago Reply all prgms are not there..... scribd. scribd. scribd. scribd. scribd. scribd. scribd. scribd. scribd. scribd. scribd. scribd. scribd. About

About Scribd Blog Join our team! Contact Us

Premium

Premium Reader Scribd Store

Advertise with us

Get started AdChoices

Support

Help FAQ

Press

Partners

Developers / API

Legal

Terms Privacy Copyright

Copyright 2013 Scribd Inc. Language: English