[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]


    Search the Q&A Archives


question related to c programme. main ( void ) { ...

<< Back to: comp.lang.c Answers to Frequently Asked Questions (FAQ List)

Question by parmi
Submitted on 1/20/2004
Related FAQ: comp.lang.c Answers to Frequently Asked Questions (FAQ List)
Rating: Rate this question: Vote
question related to c programme.

main ( void )
{
   char a;
   printf ( "%d       %d\n", sizeof( char ) , sizeof ( 'a' ) );
exit(0);
}
out put is 1 , 4 ;
how is this sizeof 'a'is 4



Answer by harish
Submitted on 3/4/2004
Rating:  Rate this answer: Vote
character is nothing but a short int.
according to the ascii set every printable character has a ascii code (positive) which is an int .eg 'a'  97 etc.even characters can be used in expressions like arr['a' - 32]
this will give u the difference .here it will take the ascii value of 'a' and subtract 32 from it and use it for array indexing.so if on ur machine int is 4 bytes it will give u 4 0r 2 since the size of int is not portable.size of char is 1 byte so it will display 1.

 

Answer by bimala
Submitted on 3/15/2004
Rating:  Rate this answer: Vote
I need some turbo c program and function call program

 

Answer by Amer
Submitted on 4/2/2004
Rating:  Rate this answer: Vote
ich brauche ein programm zur sortierung eines float arrays und dazu die zeit messung ,in der der programm brauchte zur sortierung aufsteigend,absteigend ,unsortiert.

 

Answer by toasty roaster
Submitted on 4/19/2004
Rating:  Rate this answer: Vote
fritch gebrannte mandeln

 

Answer by vishnu shankar
Submitted on 5/28/2004
Rating:  Rate this answer: Vote
i want some basic programme to learn c

 

Answer by moumita
Submitted on 7/9/2004
Rating:  Rate this answer: Vote
1
23
456
7890

 

Answer by guddi
Submitted on 2/7/2005
Rating: Not yet rated Rate this answer: Vote
i would like to see some more programs

 

Answer by avijit
Submitted on 2/25/2005
Rating: Not yet rated Rate this answer: Vote
                   1
               1   3   1
           1   3   5   3   1
       1   3   5   7   5   3   1
up to n times.

 

Answer by patel pathik
Submitted on 11/16/2005
Rating: Not yet rated Rate this answer: Vote
#include<conio.h>
#include<stdio.h>
void main()
{
   int i,j,n=5,k=0;
    clrscr();
   for(i=0;i<=n;i++)
    {
       for(j=0,k=0;j<=i;j++,k++)
        {
         printf("%d",k);
         }
     printf("\n");
    }
  getch();
}

 

Answer by c.tejus
Submitted on 12/9/2005
Rating: Not yet rated Rate this answer: Vote
answer 1 1
because char is of one bytes and a is also one bytes

 

Answer by rajesh
Submitted on 3/6/2006
Rating: Not yet rated Rate this answer: Vote
from above program,iwill display char size is 2bytes but will not display 4bytes

 

Answer by han
Submitted on 7/31/2006
Rating: Not yet rated Rate this answer: Vote
dogy

 

Answer by p.subee
Submitted on 9/7/2006
Rating: Not yet rated Rate this answer: Vote
what is mean by size of function.

 

Answer by mathi
Submitted on 10/6/2006
Rating: Not yet rated Rate this answer: Vote
'a' is a char. though it will store in memori as integer value. int is 4 byte/2byte its depends the os. so u got the  answer.

 

Answer by munesh  kumar saral
Submitted on 11/8/2006
Rating: Not yet rated Rate this answer: Vote
long integer

 

Answer by haju
Submitted on 5/16/2007
Rating: Not yet rated Rate this answer: Vote
i want to study more about cprogramme

 

Answer by kutty
Submitted on 7/4/2007
Rating: Not yet rated Rate this answer: Vote
I WANT SOME BASIC PROGRAMME TO LEARN  C  AND C++.

 

Your answer will be published for anyone to see and rate.  Your answer will not be displayed immediately.  If you'd like to get expert points and benefit from positive ratings, please create a new account or login into an existing account below.


Your name or nickname:
If you'd like to create a new account or access your existing account, put in your password here:
Your answer:

FAQS.ORG reserves the right to edit your answer as to improve its clarity.  By submitting your answer you authorize FAQS.ORG to publish your answer on the WWW without any restrictions. You agree to hold harmless and indemnify FAQS.ORG against any claims, costs, or damages resulting from publishing your answer.

 

FAQS.ORG makes no guarantees as to the accuracy of the posts. Each post is the personal opinion of the poster. These posts are not intended to substitute for medical, tax, legal, investment, accounting, or other professional advice. FAQS.ORG does not endorse any opinion or any product or service mentioned mentioned in these posts.

 

<< Back to: comp.lang.c Answers to Frequently Asked Questions (FAQ List)


[ Home  |  FAQ-Related Q&As  |  General Q&As  |  Answered Questions ]

© 2008 FAQS.ORG. All rights reserved.