Friday, May 21, 2010

"C" programming experience and expects plzzzzzzzzzzzz?

i did "C" programming i have very much confusion.


in the class our madam said "C" "program have logic",


every program have logic.


but i didn't understand what is "logic"


i tried dictionary but the answer is different could you please help me


becase i completed the "C" language course but i didnot meaning of logic according to programming language


thankyou


madhus

"C" programming experience and expects plzzzzzzzzzzzz?
Well Dear,





Dont worry!!! Logic is nothing but an Idea or a thought.


let me tell u more clearly, u know how to add two numbers





example: 5 + 5 = 10 --%26gt; x + y = z





So by adding 2 numbers u'll get Sum right [this is a logic for writing program on sum of two numbers] ... Similarly u need 2 inputs for writing a program... x and y [ above example] and an output sum [z] .





As u said u have completed ur course.... daily u need to practice on a system so that u will be in a stage to develop logics[ ideas] and even u may become Genius in this subject !





Hope u got it dear.... All the best!!!


Takecare :)
Reply:logic is just used for programming thats it .


whatever programming language we use to create program we need to know how the program work i.e what is its use


that is called as logic;


for example if u need to add two nos u need only two variables


but if u need to add n nos say 10


u must use array here and any loop statement


this is called logic


in simple words logic is nothing but just the idea about a program
Reply:hi madhu!


we programmers call logic as 'common sense'. but common sense is not so common.





ok i won't create more confusion.


just think of the answer to the following question.





if i ask 5 people to combine 2 digits to make 5 then


person 1 may think of 4 + 1 = 5


person 2 may think of 1 + 4 = 5


person 3 may think of 3 + 2 = 5


also there might be some people thinking of 6 - 1 = 5


and 5 + 0 = 5.


so it means that the above problem can be solved but in different ways by different people. also there can be many solutions to a problem but some of them are fast and easy while others may be lengthy and tedious.


thus it means that logic is something we use to solve a problem.





it terms of programming it means to arrive at the solution to a problem in the most easiest way which is also fast and efficient.
Reply:Logical operations include AND - OR- EXCLUSIVE OR and NOT operations. Real world examples:


1. If the car has gas AND the sun is shining we will go to the fair.


a. the car has no gas, the sun is not shining, No fair


b. the car has no gas, the sun is shining, No fair


c. the car has gas, the sun is not shining, No fair


d. the car has gas, the sun is shining, Go to fair


2. Logical


Gas= false Sun= false Fair = false


Gas= false Sun=true Fair= false


Gas= true Sun= false Fair= false


Gas= true Sun= true Fair= true


3. Binary


0 and 0 = 0


0 and 1 = 0


1 and 0 = 0


1 and 1 = 1
Reply:Hi,


Not only C but any other programming language has logic.





Each student in ur class is not learning C --%26gt; It means there r students those r learing other softwares also.


--%26gt;It also means other courses r also available in ur institute.





It means u have some facts and u r to draw meaning out of it.


It is logic. This is what that is used in programmes.





Logic means u are to give command to a computer in a way that it could give u desired results.


e.g;





The following statements will first clean the screen the print "Logic".


clrscr();


printf("Logic");





The following statements will first print "Logic" then clean the screen





printf("Logic");


clrscr();





So u cant see any output on the screen. So logically first u have to clear the screen then print something.





If a door is already closed. can u close it again.. Logically if door is closed, u can open it only.





or if a door is closed u cant go out unless u open it. Similary if a file is open u cant open it again.


If a file is closed u cant read/write anything in it unless u open it first. This is logic.
Reply:hi, dont be afraid of the term 'logic', it is a just english word.


Actually by logic your mam means that --"there is a concept behind every program".


I think firstly i make u clear that what a program is?


Everything what a human can do manually, can be converted into program.





There is a basic concept behind everything.


Just imagine how u make calculations.while doing multiplication, u have in ur mind the concept of doing multiplication. that is called logic..


Have u ever made a program of pyramid like





*


**


***


****





in this program there is the logic that u have to use two loops.





i think i made it very clear to u that what is logic.





For more help i am always be there on yahoo answers.
Reply:Logic is what I call common sense the ability to understand how things work and or how to follow what someone is saying or to Read between the lines.


http://www.devarticles.com/

white flowers

No comments:

Post a Comment