Important alert: (current site time 7/15/2013 6:23:02 PM EDT)
 

VB icon

A basic code for program without using semicolon

Email
Submitted on: 7/1/2004 5:29:22 AM
By: Shantanu Bansal 
Level: Intermediate
User Rating: By 22 Users
Compatibility: C, C++ (general), Borland C++, UNIX C++
Views: 23831
(About the author)
 
     Please, rate this code, Your vote - our motivation by Shantanu Bansal This is a tricky c/c++ program or code to help writting a program without using (;) semicolon. In this example, program will print a line without using semicolon. Help mail: shantanubansal@indiatimes.com
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
//**************************************
// Name: A basic code for program without using semicolon
// Description:Please, rate this code, Your vote - our motivation by Shantanu Bansal
This is a tricky c/c++ program or code to help writting a program without using (;) semicolon.
In this example, program will print a line without using semicolon.
Help mail:
shantanubansal@indiatimes.com
// By: Shantanu Bansal
//
//This code is copyrighted and has// limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=8140&lngWId=3//for details.//**************************************

/* c/c++ tricky code */
/* Author - Shantanu Bansal */
/* for any type of assistance mail me at shantanubansal@indiatimes.com, shantanubansal@hotmail.com*/
/*
 This is a tricky c/c++ code to help writting a program without using semicolon.
 In this example, program will print a line without using semicolon.
 */
# include<stdio.h>
# include<conio.h>
void main()
{
	if ( printf("Program without semicolon\n"))
	{
		if ( printf("successful"))
		{}
	}
	else
	{
		if ( printf("Failure"))
		{}
	
	}
}


Other 3 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
7/2/2004 9:40:12 AMVisualcode

What did you guys think this was when you came to look at his/her code? It is not mislabeled, it does EXACTLY what it said. If you don't like the code, don't vote. There however, is no reason to vote bad, or talk bad to him/her. Think it doesn't belong on PSC? Report it, other than that leave it alone. The code should be voted on by how well it does what it says, and viewed by how much it seems YOU would find it useful to you. It is people like you making this site horrible.
(If this comment was disrespectful, please report it.)

 
7/2/2004 9:40:22 AMVisualcode

People post no code, and you all yell at them. One of you that normally do the yelling post no code, and talk about how you wish they wouldn't do that, and the rest of you vote for it with tons of +5. You guys are ruining this site, and I miss how it used to be, lately it is trash, all because of you people. I no longer post on PSC because of people like you. I will not share my code with ingrates. I wish there was something Ian could do, but unfortunately there isn't. Why don't you guys start showing a bit more respect?
(If this comment was disrespectful, please report it.)

 
7/27/2004 7:06:45 PMAenox

This code is extremely useful to anyone who has suffered the loss of their semi-colon key. May there be many more character exclusions in future.
(If this comment was disrespectful, please report it.)

 
8/9/2004 5:22:57 PM3K Tech

I don't know how many people know this, but if your careful, you can also execute more than one statement in an 'if'. You can use a comma to separate different expressions, like this.

if (
printf("Program without semicolon\n") ?
(printf("successful\n"), printf("plus somemore\n")) :
(printf("failure"), printf("extra stuff"))
)
{}

This program will do the same thing as above, but it will print out one more statement, and is just a different way of writing it.
(If this comment was disrespectful, please report it.)

 
8/9/2004 8:27:03 PMLkNsngth

3K Tech. The code you wrote. I noticed it had : . Doesnt the color share the same key as the ;?
(If this comment was disrespectful, please report it.)

 
8/19/2004 10:41:58 AMAlpha Binary

oh just perfect. -_-
wouldn't || and && also help?
(If this comment was disrespectful, please report it.)

 
8/27/2004 3:17:33 PM

i was in the search of this idea to how to write a programe in c witout using semicolon, but fortunately i got ans here only. it is realy a great experince. carry on the spirit
(If this comment was disrespectful, please report it.)

 
9/3/2004 10:26:33 AMzer0python

Nifty.. not exactly something I would've thought up, but definately nifty.. only one question, how would you do it if it was a void function?
(If this comment was disrespectful, please report it.)

 
10/2/2004 11:48:24 AMAndrew Nielsen

It's a neat idea, rather thoughtfull. I fail to see the applications outside of smaller programs that, like mentioned, don't use void functions. But, considering I may not have thought of this, I'll give an excellent rating. Keep up the unique forms of thought. :-)
(If this comment was disrespectful, please report it.)

 
10/4/2004 9:54:05 AM

Cute factor 10. Usefullness factor 0. This looks like the same code posted here a few months back by someone. It was a waste of brain cells then and it's a waste of brain cells now.
(If this comment was disrespectful, please report it.)

 
10/16/2004 3:42:04 AMAlex Bylund

clever fun
(If this comment was disrespectful, please report it.)

 
7/19/2005 2:49:23 AMAlexander Moore

Interesting, but what use does it serve? Four globes.
(If this comment was disrespectful, please report it.)

 
8/22/2005 1:20:02 PMJonathon henderson

not too useful but nice 1 :) very interesting
PS: i had to add this on the end to keep it on screen :P

if (getch()){}

lol nice work :D
(If this comment was disrespectful, please report it.)

 
9/13/2005 3:30:23 AMAndy Ward

100% for being inventive. Usefullness = 0% though. The code would execute slower simply because the ; is ommited. That said, I am still impressed.
(If this comment was disrespectful, please report it.)

 
1/9/2006 11:32:27 PMmohit

ultimate source code
(If this comment was disrespectful, please report it.)

 
4/1/2008 5:31:07 AMrajneesh

it's a good source code keep it up and if u have some good programming questions which require logical things please mail them to me i'll be thankfull to you
(If this comment was disrespectful, please report it.)

 
11/10/2009 2:20:56 AMAusbrecher

But what's about the return function?
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.