Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 22-03-2008, 04:38 PM   #1 (permalink)
Traceur
 
zegulas's Avatar
 
Join Date: Oct 2003
Location: Mumbai
Posts: 276
Default Raise-to in C


How to show x^2 in C?
__________________
Parkour: A journey started by two & followed by many...
zegulas is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 22-03-2008, 04:46 PM   #2 (permalink)
Wandering In Tecno Land
 
Ecko's Avatar
 
Join Date: Feb 2005
Location: 127.0.0.1
Posts: 724
Default Re: Raise-to in C

its pow function

#include <math.h>
z = pow( x, y );
__________________
Born in Windows Die In Linux © 2009-10 All Rights Reserved.
Learn Linux : www.linoob.com (Official WebSite)
Ecko is offline  
Old 22-03-2008, 04:54 PM   #3 (permalink)
Traceur
 
zegulas's Avatar
 
Join Date: Oct 2003
Location: Mumbai
Posts: 276
Default Re: Raise-to in C

no no, i want to show it in printf, i dont want to raise actually!
__________________
Parkour: A journey started by two & followed by many...
zegulas is offline  
Old 22-03-2008, 05:10 PM   #4 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: Raise-to in C

huh
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 22-03-2008, 05:17 PM   #5 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Raise-to in C

If you're using extended ASCII, you can do it using (char)253.

Sample:
Code:
#include <stdio.h>
// ASCII
int main(void)
{
    (void)printf("3%c\n",253);
    return 0;
}
This should print 3²

Or in Unicode:
Code:
#include <stdio.h>
// UTF-8
int main(void)
{
    (void)printf("3\u00B2",a);
    return 0;
}
// Requires compilation by a C++ or C99 standard compiler.
It prints the same too.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 22-03-2008, 09:21 PM   #6 (permalink)
Traceur
 
zegulas's Avatar
 
Join Date: Oct 2003
Location: Mumbai
Posts: 276
Default Re: Raise-to in C

Thanx a lot QwertyManiac!! []
__________________
Parkour: A journey started by two & followed by many...
zegulas is offline  
Old 23-03-2008, 02:50 AM   #7 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: Raise-to in C

^^the orkut addiction's prime example
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 23-03-2008, 09:23 AM   #8 (permalink)
Traceur
 
zegulas's Avatar
 
Join Date: Oct 2003
Location: Mumbai
Posts: 276
Default Re: Raise-to in C

T159, I agreed to what you said above! But don't post stuff like "huh" as you have done above. The post counts don't matter, if you have information to share then just do that.
__________________
Parkour: A journey started by two & followed by many...
zegulas is offline  
Old 23-03-2008, 09:32 AM   #9 (permalink)
Commander in Chief
 
QwertyManiac's Avatar
 
Join Date: Jul 2005
Posts: 6,658
Default Re: Raise-to in C

Quit it guys, don't go off-topic.
__________________
Harsh J
www.harshj.com
QwertyManiac is offline  
Old 23-03-2008, 11:36 AM   #10 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,675
Default Re: Raise-to in C

Quote:
Originally Posted by zegulas View Post
T159, I agreed to what you said above! But don't post stuff like "huh" as you have done above. The post counts don't matter, if you have information to share then just do that.
the huh part was for phenom, now it seems he has deleted his post

sorry i dont care abt post counts, you will find my most of the posts in chit chat section and gamers section.

sorry if u felt bad abt that , ask anything abt algorithms and language to Qwertymaniac
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 23-03-2008, 11:12 PM   #11 (permalink)
Traceur
 
zegulas's Avatar
 
Join Date: Oct 2003
Location: Mumbai
Posts: 276
Default Re: Raise-to in C

So sorry T159, I misunderstood you.
__________________
Parkour: A journey started by two & followed by many...
zegulas is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Raise Your Windows Vista Experience Index ... with a Tweak !!! anandk Tutorials 10 08-05-2009 06:40 PM
Work, Work & Work.... u get no raise ! vish786 Chit-Chat 5 14-09-2007 03:49 PM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2