Friday, July 31, 2009

Explain data type range for integers in C language?

Why am i getting this output for the following C program?





#include %26lt;stdio.h%26gt;


#include %26lt;conio.h%26gt;





int input=-2147483649;


main()


{


printf("%d",input);





getch();


}








Output:


2147,483,647

Explain data type range for integers in C language?
Dude you need to go out more .
Reply:Hi


As a previous answerer has intimated int (or long int) overflows outside of the range -2147483647 to +2147483647





Suggest you use:





double inpt = -2147483649.0;


main()


{


printf("%10.0lf\n",inpt);


}





This will give you what you want.


Regards


G
Reply:Range = -pow(2, 31) to pow(2, 31) - 1





-2147483649 is less than -pow(2, 31)


(by one actually)
Reply:because that is max limit





it is converting it to +ve number because 1 bit is used for sign (lsb or msb ? )


I/O header file error in c language?

Whenever I tri to compile the c program it give me error that i/o header file is not included.i have set the right path in directory still It is giving me error .How can I remove it. Hel p me plz .

I/O header file error in c language?
You mean stdio.h? You should include it like this:





#include %26lt;stdio.h%26gt;





A common mistake is to use quotes instead of angle brackets, but all system header files require the brackets.
Reply:YOU FIRST CHECK OUT WHETHER THE IO HEADER FILE IS IN INCLUDE DIRECTORY .IF IT IS NOT THERE PLEASE COPY FROM ANY WHERE AND PUT IT IN THAT INCLUDE DIRECTORY.IF U ARE USING C EDITOR FROM UR C:WINDOWS U HAVE TO COPY THE ENTIRE 'C' PROGRAMFILES IN THAT(C:\).IF NOT U CAN USE OTHER DRIVES BY SETTING PATHS AS FOLLOWS:


1.GO FOR OPTIONS INTHAT GO FOR DIRECTORIES :


2.HERE YOU HAVE FIEDS TO ENTER


a.INCLUDE\


b.LIBRARIES\


c.OUTPUT\


PLEASE FULFILL THE FIEDS AS FOR UR 'C' SETTINGS.


AND ENJOY THE 'C' PROGRAMING.

yu gi oh cards

How to use random functions in 'c' language?

how do u use the random function in c........?


i want the function to generate values between a specific range of values........

How to use random functions in 'c' language?
The rand() function will always return a value between 0 and an implementation-defined quantity, RAND_MAX. To use rand() to produce integers in the range from x


to y, inclusive, you should use something like:





/* initialize random generator */


srand ( time(NULL) );








int result = x+(int) ((y -x +1) * (double)rand()/(RAND_MAX + 1.0));


____________________








/*Alternative: Use the modulus operator (%) to bring the number in range.*/





printf ("A number between 0 and RAND_MAX : %d\n", rand());





printf ("A number between 0 and 99: %d\n", rand() % 100);





printf ("A number between 0 and 9: %d\n", rand() % 10);
Reply:#include %26lt;time.h%26gt;


#include %26lt;stdlib.h%26gt;





main()


{


srand(time(0));


int random=rand()%255+1; //from 1 to 255


}
Reply:#include %26lt;time.h%26gt;


#include %26lt;stdlib.h%26gt;





int main()


{


srand((unsigned)time(0));


int random=rand()%10+1; //from 1 to 10


}


How to make chatt room using C# language?

i want to make my final project on chatroom so i want to write the code in c# what are the core thing that i have to know

How to make chatt room using C# language?
hi dear ,first you have to have a good knowledge on staff like html,C# and .... but, it is possible to desigen chat room simply by using frames to desigen


How can i save graphics in c language?

I have a program in c that generates a graphics output using graphics.h. But i cant seem to save the graphic as a file. How do i do this?

How can i save graphics in c language?
you save the program in a folder named c:\cprog (say)


Then you compile and run the program...


After that come out and go to cprog folder you will find two file in that one exe file will be there...


You can double click that.. you can see your graphics..


You can change the icon for that file that suits the graphics...


Okay...


I want to do projects on c language?pls tell me d related websites?

i want to do projects on c,to earn money

I want to do projects on c language?pls tell me d related websites?
Take a look here so you can have a base


http://en.wikipedia.org/wiki/C_programmi...





Then you should try to look for a job with this language. So you can learn more.

thank you cards

Hi I'm a beginner for c language, any free compiler on line?

haveing windows xp OS in my pc.


i want a link for c compiler for free...

Hi I'm a beginner for c language, any free compiler on line?
http://www.acms.arizona.edu/education/op...
Reply:You can use Turbo C Compiler.


It can be used for a beginning stage. And if you want to go further use GCC (In Linux) or You can get MinGW which is Minimal GCC for Windows. Try it out.
Reply:C++, The Borland C++ free Compiler #1 -...


The first line tells the C compiler to include the header file "iostream.h" ... I do not mind the "C" language per se, but...


cpp.codenewbie.com/articles/cpp/1452/....


The Borland C++ free Compiler #1 - Code...


The first line tells the C compiler to include the header file "iostream.h" ... I do not mind the "C" language per se, but...


codenewbie.com/forum/c/717-borland-c-f...


Free C/C++ Compilers and Interpreters -...


Pelles C Compiler ... applications you compile with this free compiler, but you should read their ... extensions to the C...


www.mycplus.com/forum/forum_posts.asp?...
Reply:download it from download.com bloodshed is good
Reply:no compilers are free...


but some are available on internet as pirated..u may download them..


some popular compilers are Turbo c,Borland C
Reply:I like Bloodshed Dev-C++, which is obviously a C++ IDE/compiler, but should do plain C code as well? It's free, anyway.


I need a text editor in c language alone pls help me out....?

tat should of pure c code ...

I need a text editor in c language alone pls help me out....?
I Think You Want The Source Code For A Text Editor,


Check This


http://www.programmersheaven.com/zone3/m...





If You Mean A Text Editor To Edit C Code


Check This


http://textpad.com/download/index.html





Anyway Your Anser Is, This Will Help ;-)
Reply:If you mean the source, write it. If you mean an executable text editor - you don't run C code, you run the .exe file the C code compiles to, so it doesn't matter what language it was written in.


Help me in my program in C-Language !!! Please!!?

PROBLEM 1:The National Earthquake Information Center has the following criteria to determine the earthquake damages. Here is the given richter scale serve as an input data and the characterization as output information.


RICHTER NUMBER (N)....CHARACTERIZATION


N%26lt;5.0---------little or no damage


5.0%26lt;=N%26lt;5.5-----some damage


5.5%26lt;=N%26lt;6.5.---serious damage


6.5%26lt;=N%26lt;7.5----Disaster


Higher.---------Catastrophe


Solution: use the else if case conditional statement.





Problem 2:


Write a program in C for the Air force to label an aircraft a military or civilian.The program is to be given the plane's observed speed in km/h %26amp; its estimated length in meters.For plane travelling in excess of 1100km/h %26amp; longer than 52m, you should label them as"civilian"aircraft,%26amp; shorter such as 500 km/h %26amp; 20m as"military"aircraft. For planes travelling at more slower speeds,you will issue an "It's bird"message.


SOLUTION:use ladderized case conditional statement.

Help me in my program in C-Language !!! Please!!?
solution for first one:


#include%26lt;stdio.h%26gt;


void main()


{


float N;


printf("Enter the Ritcher number\n");


scanf("%2f",%26amp;N);


if(N%26lt;5.0)


printf("Little or no damage");


else if(N%26gt;=5.0 || N%26lt;5.5)


printf("Some damage");


else if(N%26gt;=5.5 || N%26lt;6.5)


printf("Serious damage");


else if(N%26gt;=6.5 || N%26lt;7.5)


printf("Disaster");


else


printf("Catastrophe");


}


Some Interview Questions that I need solution in C language...?

1. Given 2 files, f1 and f2 with thousands of name each. Find the common names in the two files. Extend this to 3 files.





2. Algorithm to count most user viewed pages.





3. Code to find dot and cross product





4. Write a function that accepts a function pointer and check the procId of the calling process. Check if the process was alive at a specific interval. If yes, then invoke the function (pointed to by the function pointer) else return. Write another function that would take a request from the process to stop the first function





5. You have 50000 html files, some of which contain phone numbers. How would you create a list of all the files which contain phone numbers?





6. Write C code for 'tr' program.


C:\%26gt; tr abc xyz %26lt;file name%26gt;


replaces all occurances of a by x, b by y and c by z in %26lt;file name%26gt;





7. Given a sentence, find if a specific word occurs in it.





8. Write the data structure for jigsaw puzzle. Assume that there is some method which can tell if 2 pieces fit tog

Some Interview Questions that I need solution in C language...?
Dude, you can't get a job by asking solution to problems. Atleast try solving them and then you can ask your doubts one at a time.


No one will solve all these problems from scratch. You need to do some work at your end.

potential breakup song

How can i write a c language program to determine whether 4 digits are palindrome or no?

please help just by telling me how can i define palindrome in C program, i don't want the whole program.

How can i write a c language program to determine whether 4 digits are palindrome or no?
If you are only worried about 4 digits then:





If variable s is the 4 digit string


If (s[0] is equal to s[3]) and (s[1] is equal to s[2]) then it is a 4 digit palindrome.





Use your knowledge of C to implement this suedo code.





==Edit==


* Sheqi actually has an elegant solution (I gave it a thumbs up) but reversing the 4 digit is an extra step you don't need.


* richarduie has an example of what I said.


* I'm not sure what Alexanders code does without tracing it. It might work if when you said "digits" you meant numbers but I would trace it before I handed that one in.


* Curious George has some C++ code so don't copy that verbatim to answer your "C" question. It will just raise eyebrows.
Reply:This will work for any number of type "int":





int a = /*needed number*/;





int x = 0;


int z = a;


while (z)


{


x *= 10;


x += z%10;


z /= 10;


}


if (x==a)


{


/*number is a palindrome*/


}


else


{


/*number isn't a palindrome*/


}
Reply:bool isPalindrome(const std::string %26amp;str)


{


std::string::const_reverse_iterator itEnd = str.rbegin()++;


for (std::string::const_iterator itStart = str.begin(); itStart %26lt; itEnd.base(); ++itStart, ++itEnd)


{


if (*itStart != *itEnd)


{


return false;


}


} return true;


}
Reply:For a four-digit number, break the number into digits. For instance, 5678 would decompose into 5, 6, 7, 8. Compare the first and last for equality. Compare the second and third for equality. If both pairs are equal, the number is palindromic.





E.g.,





2452 --%26gt; (2 == 2) %26amp;%26amp; (4 == 5) --%26gt; true %26amp;%26amp; false --%26gt; false





3663 --%26gt; (3 == 3) %26amp;%26amp; (6 == 6) --%26gt; true %26amp;%26amp; true --%26gt; true





2452 is not a palindormic number; 3663 is.
Reply:A palindrome is a word, phrase, number or other sequence of units that has the property of reading the same in either direction.





Reverse the order of the string and compare with the original.


Can we connect database in 'C' language?

i need to connect a database in a C program and i have to enter the data in the database and retrieve it in runtime

Can we connect database in 'C' language?
Unix platform? What database?





Update: Why use C for this? Access has its own (VB-based) GUI. If you have to use C, you need the C API for MS-Access. Are you using a Visual C tool?
Reply:Almost any language can be used to connect to any database, so yes, you can connect to an Access database with C. I'd suggest using an ODBC connection (see the link for connection strings - Access 2007 is 2007 and later).


How can I get fully knowledge about c++ language(object oriented language),tell me the good sites for this?

computer language forcomputer students

How can I get fully knowledge about c++ language(object oriented language),tell me the good sites for this?
Hi Try some books!





Search C++ e books on this link


http://www.esnips.com/_t_/





BEst way of learning things is to play with it. try removing and adding and manupalating thing! And i think u will learn language. Consult books
Reply:A little more work and you can get a B-, give it a try.
Reply:www.bigbanyantree.com


Question about a program in C language,?

can someone give me d code to print d following series in C.


1


2 2


3 3 3


.


.


.


.


and so on...........


i actualy want it in form of a tree.


1 in d centre, 2 on either side of 1 on next line and hence......

Question about a program in C language,?
#include %26lt;stdio.h%26gt;





int main(void)


{





//represents the row


for(int i=0;i%26lt;10;i++){


//puts spaces in that aligns to the right side


if(i!=0){


for(int p=0;p%26lt;i;p++){


printf(" ");


}


}


//draws the numbers in column


for(int k=10-i;k%26gt;0;k--){


printf("%d",k);


}


//new line


printf("\n");





return 0;


}
Reply:This so-called "best answer" didn't even compile! So to even suggest that this was the best answer is ridiculous. Report It

Reply:for(L=1; L%26lt;=3; L++)


{


for(i=1; i%26lt;=40-L; i++)


printf(" ");


for(j=1, x=1; j%26lt;=2*L; j++,x++)


printf("%d",x);


}





try that.. ijust freehanded it.. i dont really know if it works..


just modify it if there are problems..you can do it..
Reply:Ok, I am going to mark this "interesting". It strikes me that we want as simple a solution as possible, as long as it works in standard (ANSI) C. Here goes:





#include %26lt;stdio.h%26gt;


/* Width of output */


#define W 80


/* Maximum count */


#define M 10





/* Generate i repetitions of character c, returning a string */


char *reps(int i, char c, char *buf)


{


buf[i] = '\0';


while (i) buf[--i] = c;


return buf;


}





int main(void)


{


int i;


char buf[M];





/* We use the * format option to choose field width, and


this is used to center the line. reps() is used to generate


the output data. */


for (i = 1; i %26lt; M; ++i) printf("%*s\n",(W + i) / 2, reps(i, '0' + i, buf));


return 0;


}





This works -- with the caveat that the even strings are always offset from the odd length strings (we can't print 1/2 of a character).





Another solution is to use two printf()'s. The first would generate a null string with padding to the length of the select string. Then, we replace the padding spaces with the target character, and printf() the result with padding to effect the desired centering. We still need to scan the print string for the replacement, so it ends up being more complex than this code. Or, we could use counters, and putc()...
Reply:Here you go (this one actually works) but your prof will never believe you came up with this on your own. :-)





//////////////////////////////////////...


#include %26lt;string.h%26gt;


#include %26lt;stdio.h%26gt;





#define MAXNUM 20





int main(int argc, char **argv)


{


int i, j;


char numbuf[3] = {0x30, 0x20, 0};


char outbuf[MAXNUM * 2 + 1];


char padbuf[MAXNUM * 2];





// calc what the width from left edge to center


// will be for the bottom row


int basewidth = (MAXNUM * 2) - 1;





// fill padding buffer with spaces, to


// longest length needed


for (i = 0; i %26lt; MAXNUM * 2; i++)


padbuf[i] = 0x20;





for (i = 1; i %26lt; MAXNUM + 1; i++)


{


// add 0x30 to last digit of iterator


// to get ascii value of chars '1' - '0'


numbuf[0] = (i % 10) + 0x30;





// truncate output buffer


outbuf[0] = 0;





// fill output buffer with repetition of number


// buffer


for (j = 0; j %26lt; i; j++)


strcat(outbuf, numbuf);





// shorten the padding buffer by null-terminating


// it at the correct length for this level


padbuf[basewidth - ((i * 2) - 1)] = 0;


printf("%s%s%s\r\n", padbuf, outbuf, %26amp;outbuf[2]);


}


return (0);


}

love song

What are the benefits of c language can u tell me plz?

means what are the advantages of c lang

What are the benefits of c language can u tell me plz?
C is very imp language dis days...it is user friendly and very easy to learn...


C is very simple as compared to other languages such as JAVA...bcoz in C there r very less functions which r very simple to use.....


moreover if ur interested in aeronautics sort of stuffs dan C is must.....bcoz in the programming of shuttle and robots scientists use C language


recent robot which was sent to mars was programed by C


so u see its imp and rather interesting also.......
Reply:it has no advantages over assembly, sry
Reply:what is c language?
Reply:what is c?
Reply:If you are asking about C programming language, you are in the wrong section.


How to save records in C language & effective way to retrieve them up?

in C i am making a project in which I have to save the date %26amp; occasion related to that day


I want to know how I can effectively store this record?


in future i have to retrieve it also?


please help..............

How to save records in C language %26amp; effective way to retrieve them up?
Try something like:





/* fopen example */


#include %26lt;stdio.h%26gt;


int main ()


{


FILE * pFile;


pFile = fopen ("myfile.txt","w");


if (pFile!=NULL)


{


fputs ("fopen example",pFile);


fclose (pFile);


}


return 0;


}
Reply:A database seems like the logical choice. However you could just as easily store the information in a flat text file.


Can someone write this in C language?

a) Write a function that will return a random double number. The function takes two parameters (both integers). The first parameter is the maximum whole-number value that the number can be (the minimum is 0.) The second parameter is how many places of random precision the number must have.







































































b) Write a line of code that will call the function you just wrote above and ask it to generate a random number from 0-100 with two places of precision, saving the return value in a variable (declare it) named ran.

















c) Print the value of ran to two places.

Can someone write this in C language?
it is not working


check this with user flames in yahoo he will help you









































HA
























































HA












































HA









































HA



































HA



































ur rite
Reply:Yes,















































that






































is












































easy.


Which all operating systems support C language?

do xenix,unix support C?

Which all operating systems support C language?
All of them





C is a general-purpose, block structured, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.[2] It has since spread to many other platforms. Although C was designed as a system implementation language,[3][4] it is also widely used for applications. C has also greatly influenced many other popular languages,[5] especially C++, which was originally designed as an extension to C.





Despite its low-level capabilities, the language was designed to encourage machine-independent programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with minimal change to its source code. The language has become available on a very wide range of platforms, from embedded microcontrollers to supercomputers.
Reply:i THINK THE WAY U ASKING QUESTION ,IS NOT CORRECT, ALL OPERATING SYSTEM SUPPORTS DEPENDS ON C -COMPILER
Reply:All operating-systems support C, if they have a C compiler available for them. In fact it would be more relevant to ask which CPU architectures support C because pretty much every O/S has a C compiler. Though almost every well-used CPU has at least once C compiler, so that is just as pointless.





In short, any modern computer will have a C compiler available for it. Probably quite a few C compilers from various vendors, along with open-source versions that are likely to be of a similar quality. Take your pick, they'll all do the same job- give or take how optimised the compiled code is.
Reply:Man, back in the day (Bell Labs, Murray Hill NJ CA 1972) the C programming language and the Unix Operating System were developed together by Ken Thompson, Dennis Ritchie and others. In point of fact after the first version Unix was written and developed in C.





While Microsoft based its OSes (through various strange iterations) on something called CP/M, from DOS 2.0 it has been heavily influenced by Unix and I have no doubt have licensed the whole OS 2 or 3 times over for use in Windows (One can establish at least 4 licenses with Unix Developers, and though one of them is SCO which claims copyrights owned by Novell who are suing Microsoft over Word Perfect it is by no means their only license and calling them pirates in this instance is absurd -- they certainly don't use all the code they license but any code in there is presumably covered by an existing contract).





Further, Steve Jobs is a huge Unix fan and the MacOS follows his NextStep OS in being built on the Berkely Standard Distribution of Unix. Linux has C because it uses the GNU tools which were developed on Unix -- GCC and you can rest assured, if it's derived from Unix, it supports GCC. Unix, Xenix, Linux, Irix, Citrix and the MacOS ALL support C. And C++.
Reply:Your question is phrased incorrectly. There are many diff versions of the C compiler. The o/p of the compiler i.e the executable code is what that determines if the code can be executed from an operating system. Borland %26amp; Turbo C support DOS ans WINDOWS, Solaris C supports Unix and so on.

garden flowers

What are the benefits of c language can u tell me plz?

means what are the advantages of c lang

What are the benefits of c language can u tell me plz?
C? This question belongs in the Computers and Programming forums, sorry this forum is for human languages.
Reply:The C language is so called a Low-level language.


I think that is benefit is to make a balance between the time needed when you code (takes more time that a high level language but you earn some time if we compare to assembly language) and the speed of the code that is running (not the fastest but fast)





Too, the C language is standardised by the ISO. It means that if you respect the standards, youy code is intended to run on different plateforms.





Nowadays, if we exclude the field of electronics, industry, this language is old, but almost all the new generation languages are based or inspirated by it.
Reply:if i am not wrong then you must be talking about the c++ ...... if you are talking about this then let me tell you this is knows as forth generation language in foreign countries this used to make bespoke software and other it field and if u are good practically then u can make fortune in Europe?
Reply:If you really know what you are doing, you can micromanage the processor and have it do exactly what you want, without the overhead of a lot of the other languages.





Plus, the core C language itself is extremely small and generic, which means that most systems will have a C compiler for them, and relatively quickly. This means you can use one language to code for a huge variety of systems without having to learn that systems machine code, or worrying that some other language will replace it.





This is opposed to other languages which are not as small, portable, or fast.
Reply:Your thoughts a bundle of emotions and ideas, in an abstract form, which cannot be communicated to others, except with the aid of language.


I need a C language program that prints all the combinations of characters from a string?

example : if the string is ABC, then all the possible combinations of A, B %26amp; C are :


ABC,ACB,BCA,BAC,CAB,CBA

I need a C language program that prints all the combinations of characters from a string?
Here is something I came up with quickly ( not fully complete, I will leave that to you ! )





This quick bit of code will give you a start ( hopefully and no recursion ).





Please note that this is not complete and you will get a memory leak in swap function ( easily fixed btw ! ).





#include "stdafx.h"


#include "stdio.h"


#include "string.h"





void manipulate( char* pString, int index );


char* swap( char* pString, int pos );





char pod[255];








int main(int argc, char* argv[])


{





char* p = "abc";


memcpy( pod, p, strlen( p ) );


for( int i = 0; i %26lt; strlen( p ); i ++ )


{


manipulate( pod, strlen( p ) );


}


return 0;


}








void manipulate( char* pString, int index )


{


int i = 1;


char* p;


p = pString;


while( index %26gt; 1 )


{


p = swap( p, i );


index--;


i++;


memcpy( pod, p, strlen( pString ) );


printf( "%s\n", p );


}


}





char* swap( char* pString, int pos )


{


char* p = new char[ strlen(pString) + 1 ];


memset( p, '\0', strlen( pString ) + 1);


memcpy( p, pString, strlen( pString ) + 1 );


char temp = p[pos];


p[pos] = pString[pos-1];


p[pos-1] = temp;


return p;


}
Reply:do your homework now, kid.... its for you to learn





if you're still desperate, contact me privately... shall be glad to teach you C

calling cards

How do you put this in C++ language?

"If c is more than 'max' and c is not equal to -99"





thx a lot, I will select the best answer in less than 2 days.

How do you put this in C++ language?
I think it depends to some extent on the compiler you use, but for the one I know so far, it would be said something like this:





If ( (c %26gt; max) %26amp;%26amp; (c != -99) );





the only part I'm not sure about is the %26amp;%26amp; as that might be "or", not "and"...I always mix them up
Reply:that makes NO sence at all!!! my answer may not be the best, but plz tell other people(and me too) what it means! that would help lots of other people. but thanx 4 the 2pt!
Reply:I agree with DonutGuy. The || (pipe) symbols are for "OR" and the %26amp;%26amp; are for "AND".
Reply:max%26lt;c%26lt;99





I've just started learning C++... and messed up compiling my very first program.
Reply:int t=((c %26gt; max) %26amp;%26amp; (c != 99))?1:0;





This will return 1 if condition holds true otherwise 0.


Function to run dos command in C language?

I want to run a DOS command from C program. What is the function in C which can run a DOS command ?

Function to run dos command in C language?
it is.....


system(DOS_command_name)
Reply:system.console.readline()





if my memory is working right
Reply:Look up the fork and exec system calls.


About in turbo c or c language..?

how to put an space in turbo c?... i mean the outcome of the program have a space.. i dont know what i gonna enter to display a space between a name after u run it.. please help..

About in turbo c or c language..?
try this .... it will take space bars also


char a[20];


printf("Enter String: ");


gets(a);


printf("Your String: %s",a);
Reply:Well done Joydeep for deciphering and answering such a badly worded question! Thumbs up to you :P Report It

Reply:Well, if you use the printf function then the format for a space is to simply include it in the format string. Example:


printf("%s is a good person.\tDon't you think?\n", MyName);


will print:


Griz803 is a good person. Don't you think?


%26lt;and leaves cursor on this line%26gt;


assuming MyName contains Griz803.


Other tutorials on C language can be found from this link, as well as tools, compilers and other free stuff.
Reply:Where do you want this space to be placed?


On the console? - printf( " " );


If you want to print some name followed by the space -- printf( "%s ", name );
Reply:Could you be more specific? Do you mean space as in a single space character, or as in whitespace, or something else? The context of this space is also highly unclear. Perhaps a code example of what you have so far might help?


What is the difference between c language,c and c++?

please give info. in detail or provide a link.


what are the functions of these three?


is learning one of these required for another one?


i want to take c courses for 11th standard in south mumbai.any suggestions?

What is the difference between c language,c and c++?
C is older and more lower-level than C++. This mostly comes into play when doing memory allocation. For example in C I would do this:





int* array = (int*)malloc(sizeof(int)*10);





And in C++ I would do this:





int* array = new int[10];





Another huge difference is that C doesn't have classes, whereas C++ does. One of the most annoying times this comes into play is when working with strings. In C is you want a smaller part of a string (a substring) you need to dynamically copy it out, but in C++ you just call string.substr().





You can learn one without the other. If you're relatively new to programming, I would start with C++ because it's a little easier and is probably more similar to any other language you have encountered.





I've posted a couple of links highlighting the differences also.
Reply:dear god if your going to answer a question please show some literacy...





C and C++...I dont know the huge difference partly because I use Java and other various languages...but I think its like comparing JavaScript to actual Java....two complete differences and I would imagine a difference in speed too
Reply:c IS c language, c++ is an object oriented version of c, it is a super-set of c. c has been around at least since the early 70s, c++ has been around since the late eighties. It probably does not make a difference which one you learn first although I would suggest c++ which contains all the features of c. vc++ is Microsoft's version of c++, it is graphically oriented like visual basic.
Reply:language,and++
Reply:u mujst refer dis site its gud for c and c++





www.cprogramming.com





and





cplus.about.com/
Reply:c++ language is a advanced than c languages
Reply:I would agree with sfpiano's comments, but would not agree with his conclusion.





First off, it is important to understand that c++ _IS_ c, but with extensions.





c++ and c are basically the same language, but c++ has additional features and abilities and extensions.





Without fully understanding the programming language that lies underneath BOTH languages, you can't program very easily in either of them.





c++ adds a LOT of functionality to c, and it does so with the understanding that the programmer understands c.





Before you can, say, declare a class that inherits from another class, and do so effectively, it's a really good idea to be able to define, say, a simple structure that does what you want it to do.





My advice would be to get comfortable with c before moving on to the extensions offered by c++. Once you know c, you can learn the extensions of c++ in a relatively short time.





I've written probably 200k+ lines of c source and 150k+ lines of c++ source.





When I code in c++, my code is more elegant and refined, but I would not have been able to reach that level of elegance if I didn't know how to do, oh, pointer arithmetic and stream manipulation.





When I say, "Get comfortable with c" I don't mean "just write in c with no c++ extensions."





Use the new operator instead of calling malloc().. That's a great idea.


Get used to declaring functions that take references instead of pointers.


But you're not even going to begin to understand my advice until you know enough about c to know what it means.





So learn c to learn what it's about, while all the time peeking at the stuff c++ can do, and implementing it once you understand it.





I hope this helps.

pokemon cards

Where can i learn C# Language Free in PDF Format?

i want to learn how to program in C#, but i need to get free stuff to learn and i need to have it in a .pdf file.

Where can i learn C# Language Free in PDF Format?
PDF Documents: http://www.ssw.uni-linz.ac.at/Teaching/L...





Check out this website:


http://www.programmingtutorials.com/csha...





It's full of info about tutorials and documents on C#. If you're familiar with C++ or Java, you should pick it up pretty quickly. You're going to need to get a copy of Visual Studio to do serious development work, and the help documents and tutorials in Visual Studio are extremely helpful!





Here's other good resources (though not PDF):


http://www.devhood.com/training_modules/...


http://msdn2.microsoft.com/en-us/vcsharp...





Good luck!
Reply:I don't know about PDFs, but Microsoft has lessons online: http://msdn.microsoft.com/vstudio/expres...





And the Express version of Visual C# is a free download, in case you didn't know. http://msdn.microsoft.com/vstudio/expres...
Reply:Check the w3.org tutorials to see if that is available.


Design a program in C language.?

Design a program in C to input your name, a friend's name and telephone number. Get the computer to print a message to you to phone your friend on the number given.

Design a program in C language.?
I don't know why people don't just ask for help with something in a program, as opposed to asking for complete source code.





I'll just give you hints:


1) Learn how to use printf() and scanf().


2) Allocate the variables you will need, based on the information you are storing. If you don't know the difference between different data types, go learn that. Do you know how to declare variables? If not, go learn.


3) Write pseudo-code to plan out how your program will work.
Reply:i agree with everyone who is in favour of not doing other homework.. but i still gave u this programm ... u know why ..coz i want u to be a looser ... rest of ur life ..


u wont understand why i places fflush(stdin) after each scanf() statement.. if u dont putit u will get unexpected results .. how will u explain ur teacher why u used fflush() .. ?


is this what u wanted ....... ?





#include%26lt;stdio.h%26gt;


#include%26lt;conio.h%26gt;





void main()


{


char *urname, *fname;


char phno[10];


clrscr();


printf("\n Enter your name: ");


scanf("%s",urname);


fflush(stdin);


printf("\n Enter your friend's name: ");


scanf("%s",fname);


fflush(stdin);


printf("\n Enter your friends phone number: ");


scanf("%s",phno);


fflush(stdin);


clrscr();


printf("\n %s, call ur friend %s on %s ",urname,fname,phno);


getch();


}





*The code submitted by the next user will give unexpected error ..
Reply:Dude, register with http://www.getphpbb.com/phpbb/index.php?...


for exciting C++ Tutorials.
Reply:#include%26lt;stdio.h%26gt;


main()


{





char a[20],b[20],d[20];


clrscr();


printf("Enter your name,friend's name and his phone number\n");





scanf("%s",a);


scanf("%s",b);


scanf("%s",d);


printf("%s, please call %s on the number %s",a,b,d);


getch();


}
Reply:This sounds like yet another student wanting somebody else to do their homework for them.





I could do this program for you, but then you would get all the credit, and I would get nothing.





If you want me to supply your answers for you, how much is it worth to you? How much are you willing to pay a professional programmer to write a program for you, anyway??? (After all, my time is valuable.)
Reply:Have a look at the stdio.h libraries. You should find usefull functions like fprintf(...) to print on screen something and gets(...) to get input text from a user.


WAP to take 2 strings from the user & find out the number of dissimilar characters in C programming language?

Write a Program to take 2 strings from the user %26amp; find out the number of dissimilar characters %26amp; display them in C programming language

WAP to take 2 strings from the user %26amp; find out the number of dissimilar characters in C programming language?
#include%26lt;string.h%26gt;


void main()


{


char a[10],b[10];


int i,y;


printf("enter your ist string");


scanf("%s",a);


printf("enter 2nd string");


scanf("%s",b);


y=strcmp(a,b)


printf("%d",y);


}











strcmp function tells that how many diferrent character the strings have


it will be in numeric


eg if output is 2


then there will be 2 different characters in strings


Free download project on c language?

example coding for c programming

Free download project on c language?
there are several sites available i can suggest a few


vyomworld.com,codeproject.com,sourceco... etc
Reply:I think i am also looking for the same.

plum

Where can i get C language projects ??

basically i want a C program on "hotel Management ".


plz plzzzzzzzzz give me a link from where i can directly download the complete program.....


thank you

Where can i get C language projects ??
yeah you can get help from


http://codingforum.info/
Reply:I don't know if they have any hotel management programs, but a great source of free programs with source code is SourceForge





http://sourceforge.net/
Reply:www.planetsourcecode.com


How can i understand c# language as a beginner programmer?

i wanna be a professional c# programmer

How can i understand c# language as a beginner programmer?
try a book


1 Csharp for beginers


2- in google, search for c sharp tutorial for beginers





you will get beatuful tutorial, than start doing every thing step by step mentioned in tutorial and you will learn it
Reply:try links on this page: http://dir.yahoo.com/Computers_and_Inter...
Reply:by understanding the small concepts and of course by a strong desire


Problems in program in C-Language.. [Please help me!!]?

PROBLEM 1:The National Earthquake Information Center has the following criteria to determine the earthquake damages. Here is the given richter scale serve as an input data and the characterization as output information.


RICHTER NUMBER (N)....CHARACTERIZATION


N%26lt;5.0---------little or no damage


5.0%26lt;=N%26lt;5.5-----some damage


5.5%26lt;=N%26lt;6.5.---serious damage


6.5%26lt;=N%26lt;7.5----Disaster


Higher.---------Catastrophe


Solution: use the else if case conditional statement.





Problem 2:


Write a program in C for the Air force to label an aircraft a military or civilian.The program is to be given the plane's observed speed in km/h %26amp; its estimated length in meters.For plane travelling in excess of 1100km/h %26amp; longer than 52m, you should label them as"civilian"aircraft,%26amp; shorter such as 500 km/h %26amp; 20m as"military"aircraft. For planes travelling at more slower speeds,you will issue an "It's bird"message.


SOLUTION:use ladderized case conditional statement.

Problems in program in C-Language.. [Please help me!!]?
May be you can search at project assignment help website like http://askexpert.info/
Reply:1)





double n=0;





Console.Writeline("Enter Richter number");


Console.Readline(n);





if (n%26lt;5)


Console.Writeline("little or no damage");


else if (n%26gt;=5 %26amp;%26amp; n%26lt;5.5)


Console.Writeline("some damage");


else if (n %26gt;=5.5 %26amp;%26amp; n%26lt;6.5)


Console.Writeline("serious damage");


else if (n %26gt;= 6.5 %26amp;%26amp; n%26lt;7.5)


Console.Writeline("Disaster");


else


Console.Writeline("Catastrophe");


What's the advantage of C Sharp (C#) language over Java?

What programming language you think is the worthiest to focus on? Is .NET technologies superior than Sun technologies.

What's the advantage of C Sharp (C#) language over Java?
C# has lot of similarities like Java. Though there are few features missing in Java(though Java is making up for it in new releases). C# had the advantage of carefully examining Java while developing their language, like delegates in C#. You could read more about the comparison at http://www.25hoursaday.com/CsharpVsJava....


As far as performance comparison is concerned it is not quite clear which one would perform better, it completely depends on what sort of application you are looking at. Though IMO Microsoft has control over its techonology hence not many IDE and servers have sprouted unlike Java. .Net developers would not be wasting their time looking for the flavour that suits them.
Reply:WEll, in my opinion, C# is good as an intro to C++. Though I think Java is better if that is all you plan on learning, not just as a gateway to something bigger. Java allows easy integration into a web browser or allows you to make apps. Also Java is fairly versatile.





So overall, Java.
Reply:Java. I will say it again. Java. Java is for like every platform and it is open sourced. .Net is only confined to windows.
Reply:C sharp is more simple then the rest. but Java is also a great programming lang.
Reply:C# applications can also be edited using J# (Microsoft's Java knockoff), or VB.NET. Also, it can use ADO.NET to connect to databases.
Reply:I think the question is where are you programming? Java seems to run better on non-Windows platforms than it does on Microsoft's OSes (probably for a reason, but I won't speculate). Furthermore, the .NET languages seem to give better performance over java stand alone applications on Windows. Why this is, I'm not sure, but I could venture some guesses. One interesting thing to note is that if you're talking about C# in a web application, the .NET FW actually converts a lot of the code into Javascript in order to function in some special ways (such as changing information on the page without communicating with the server).

parts of a flower

Windows vista and Turbo C??? Thats C Language?

I have to come know that Turbo C does not run or is not compatible with Windows Vista. Is it true???

Windows vista and Turbo C??? Thats C Language?
yes


u can work on Visual c 2005
Reply:ya, its not compatible with vista
Reply:Turbo C is not C language, it is a programming environment for C language (i.e. a software that helps you write programs in C).





I haven't installed Vista (heard too many horror stories), but a quick google search brought up quite a few (that is a LOT) of forum posts where people were complaining about Turbo C compatibility.





Turbo C is a DOS based program, though it can run under Windows OS. However Vista introduced a lot of changes which will seriously interfere with compatibility for older programs.





It is recommended that you use either Visual Studio 2005 (has Visual C++) or Dev-C++


Who can teach me c language?

who can please teach me through mail?


i dont know anything about it


all i know is it is a programme language


please dont give some site link


i want some one to teach me

Who can teach me c language?
i can teach u... a little bit of basics.. but its an assurance you'd learn enough even just the basics... you can pm me in Yahoo Messenger... my id is rdb_dvo16 ...but first u need to download BloodShed's Dev-C at bloodshed.net ... it's a compiler you need to create an exe out of the codes you are to make... Though it's not really necessary to use only Dev-C, if you have other C Compilers, it'll be enough... (^^,) but you'll have to mail me first or directly pm me if you are ready to be taught... mind you, I know how to teach.. (^^,) And it's free..
Reply:Download this: http://www.ericlindsay.com/applix/ctutor...





You can learn yourself. You must have a compiler installed in your PC. Get it from Bloodshed: http://www.bloodshed.net/devcpp.html


How to create buttons in C language?

i have done an authentication program in turbo C ,wat i need,is a button like interface so that i can provide a user friendly way of accessing it.......





this button must be in such a form that my user will be able to run the C application at the backend.......!





also, suggest some links, so that i can just check out those codes





arun,

How to create buttons in C language?
This is for DOS, right?


I'm not sure what you mean by, 'run the C application at the backend.'


Anyway, you should take a look at the functions that are defined in conio.h. (Look on the Internet if your compiler doesn't have a help file which documents those functions.) You can use those functions to draw your text 'buttons' on the screen and to get user input without having the bothersome cursor on the screen.


If you want mouse input, you'll have to look around the internet for a mouse library written in C. (Usually, the mouse functions provided by a DOS mouse driver are accessed with Assembly language, so that's why you need to find a pre-made mouse library.)
Reply:case WM_CREATE:


CreateWindow("BUTTON", "Exit", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,


butL, butT + 3 * butH, butW, butH, hwnd, (HMENU)FINISH_GRAPH, MyInstance, NULL);


return 0;





case WM_COMMAND:


switch( LOWORD( wparam ) )


{


case FINISH_GRAPH:


CleanUpAndPostQuit();


break;


}


break;
Reply:C is not the ideal language for this . Try VC++ else contact a C graphic expert at websites like http://getafreelnacer.com/
Reply:Back at Rhode Island College Professor McDowell told us that C was not a language you could do much with. If you wanted to do anything with it you needed #include files and libraries. Stdio.h and stdlib.h for example, are useful for much of what we do. And the compiler generally links libc to help them link. When I first started using C if I wanted to use a math.h function (or the double type which is included there) I had to add -lm to the end of my compilation line. Nowadays, just about any compiler will link libm to your program without being told to.





I'm on Linux so I'm somewhat rusty but if you are programming for the console, or the command line then Borland has a neat library called conio. Just include conio.h in your library. Unix/Linux (it was written for Unix but ported to Linux) has something similar called curses or ncurses. For MS-Dos/Windows you can get something similar called pdcurses, or public-domain curses. It's not open source, it's free.





Programming boxes and buttons in Windows can be more complicated. As I remember it, at least check your include files for one called "Windows.h". If you have it then all you have to do is google for Windows Tutorials using Borland. If you don't you probably need another compiler. A free one is available at:


http://www.cs.virginia.edu/~lcc-win32/ which also has a tutorial included. Visual C++ of course is also good for it.





A solution for a front end for a C program can be a scripting language such as Tk/Tcl which is available as source code from here: http://www.tcl.tk/software/tcltk/downloa... . It's sometimes used in building prototypes for programs.





Anyhow, if you have the right libraries read the documentation and it should be straightforward. If you lack the right libraries you'd better do some more research. Standard C doesn't include buttons: you're asking about extensions.


Give me good website for learning c language along with calls to unix...?

hello!


first of all thanks for u r concern.


once i came upon a c learning website which contained info on learning c as well advanced tutorial on making calls to unix functions from c program.


but ,unfortunately my hard disk crashed and i lost the name of the website which i had bookmarked. so plz help me,if u know any similar website.


it is urgent becoz my sem exams r nearing and i need to learn wat is Socket()_etc...


thanks!!

Give me good website for learning c language along with calls to unix...?
codeproject and codeguru.com may help u
Reply:You could consider visiting this link for some tutorials.


http://www.kegel.com/academy/tutorials.h...


Good Luck!

mothers day flowers

Is there a C language style (indentation, naming convention) checker, similar to Fxcop in .NET?

I am teaching a beginner's C class, some of the tools like LINT and SPLINT are too daunting for beginners, and almost everyone uses windows/DOS (hard to use some of these tools in windows for beginners). I am hoping there is some freeware or relatively cheap shareware out there. If there is open source, I may also consider making a version that is easy to use - this has to be the last option.

Is there a C language style (indentation, naming convention) checker, similar to Fxcop in .NET?
well, i can say YES there are if you are going to migrate to Eclipse IDE, there are dozens of plugins created for Eclipse that supports C/C++ with all what your heart like from style checking to code generation, memory leak busters,...etc





Eclipse is a FREE IDE created by some companies like IBM, SUN, ...etc it is mainly used for Java developing, but there exist plugins for developing in C/C++; i hope you give it a try, all who tried it, liked it!





http://www.eclipse.org





Don't forget to visit the plugins central to download the CheckStyle plugin for C/C++





Thanks.


How is the c language used in producing antivirus?

what is the practical application of C++?

How is the c language used in producing antivirus?
http://www.velocityreviews.com/forums/t2...
Reply:I dont think that you can create an antivirus software using c language


Is it dangerous to mix the C with the C++ language.?

I'm a beginner C++ programmer, i'v noticed that there are a lot of C tutorials that allow the programmer to use the win32 API without any extra support. What i was thinking, is it possible to use objects and classes and incorprest that into a C but use a C++ complier.

Is it dangerous to mix the C with the C++ language.?
Yes, you can mix the two. C++ is a superset of C *but* there are some subtle differences that can cause a headache now and again.





One big item no one here has mentioned is that because C++ supports function overloading it "mangles" function names. If you are using a unit compiled by a C compiler you must declare the header file with extern "C" scope. In essence this tells the C++ compiler not to mangle the functions names in the C++ manner but to use the C naming convention. Doing this will allow your program to link properly.





Example:





extern "C"


{


#include "some_C_header.h"


}
Reply:You can combine ANSI standard C and C++ since C++ is simply 'enhanced C'. The result is C++ code
Reply:Yes C++ is an extension of C so ANYTHING you see that is done in C WILL work in C++ ... its not dangerous whatsoever to mix the two simply because they are one and the same (assuming you use C++, since it is a superset of C)... You mention win32 APIs and i've used those within C and in C++ without any problems at all. In fact you can even not bother with objects and classes all together (making it simply a C program, for the most part) and still compile it fine as C++. C++ gives you extensions that you have at hand, it's just a matter of whether you want to use them that differentiates C and C++.
Reply:You can download a free version of Microsoft Visual C++ at the URL below. It will recognize the difference between C and C++, based on the extensions of the file names. It has built-in facilities for handling the windows API.





Yes, you can mix C and C++, but remember that most callable routines in C++ are inside of an object. So you will need to tell your C code how to get "inside" the objects, probably by treating them as "structs". Usually it is not necessary to use C if you are using C++, since C++ can do everything that C can.
Reply:Absolutely not, C++ is a superset of C, which means everything contained within in C you can do. There are a few differences. For example, in C++, main must return an int. Also, structures are declared slightly different, but you can still use the C way. Win32 API is written in C, so it should be no surprise that it works. MFC is the Win32 API wrapped in C++ classes. The important thing to realize though, when using C header in C++. Normally you include %26lt;string.h%26gt;. C++ headers leave off the extension. So many people will think %26lt;string%26gt; equates to %26lt;string.h%26gt;. This is not true. All C libraries should begin witth a 'c'. So %26lt;string.h%26gt; equates to %26lt;cstring%26gt; and %26lt;stdlib.h%26gt; to %26lt;cstdlib%26gt;, etc.


Is C language is more important or visual basic please write details?

In the other words what is a differenc between C and visual basic. I am waiting for your answers.

Is C language is more important or visual basic please write details?
If you r developing any system level things u should go for C.





While VB is mainly use for GUI based software, mainly accounting software, it would be difficult to develop system level software in VB.
Reply:c is much older and can write more powerful programs, like operating systems





vb is really just for windows programs and is much easier for someone just starting out

song downloads

Can i learn c language myself from any book?

the book language easy to undersatand .i am marathi person

Can i learn c language myself from any book?
you can try I don't see why not, but have to buy tapes so that you can practice talking and by reading books you can improve your vocabulary.
Reply:yeh surely from "THE BOOK OF COMPUTERS" by jonathan swith what always fogetting i am to tamil


What is >> in the C language? Is there an equivalent in C#?

In context, what is the following code doing? I need to translate to C#.





x = (char) (i%26gt;%26gt;8) ;

What is %26gt;%26gt; in the C language? Is there an equivalent in C#?
In C, %26gt;%26gt; is the right bitshift operator. i %26gt;%26gt; 8 shifts all bits in the variable i to the right 8 spaces.





I am not a .NET programmer, but I believe it is the same in C#.
Reply:wow Report It

Reply:%26gt;%26gt; is "shift right".


So if you have 0x500 %26gt;%26gt; 8 will be 5.
Reply:I always thought was greater than.


Who discovered the 'c' language?

it question is related to computer programing language.

Who discovered the 'c' language?
Bjarne Stroustrup discovered C and later C++ at the AT%26amp;T Bell laboratories
Reply:dennis ritchie from bell labs
Reply:C language was written by Dennis Ritchie and Brian Kernigan.
Reply:Bjarne Stroustrup developed C in 1983 at Bell Labs
Reply:C language was discovered by Dennis Ritche in 1971 at AT%26amp;T bell laboratory
Reply:People who wrote it. They didn't discover it. It's kind of like saying "Who discovered HTML?"


Quote from Wikipedia which you could've used.





C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.
Reply:C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system.





During the late 1970s, C began to replace BASIC as the leading microcomputer programming language. During the 1980s, it was adopted for use with the IBM PC, and its popularity began to increase significantly. At the same time, Bjarne Stroustrup and others at Bell Labs began work on adding object-oriented programming language constructs to C, resulting in the language now called C++.
Reply:c is a programming language developed at AT %26amp; t bell laboratories of USA in 1972. it was designed and written by a man named dennis ritchie. in the late seventies c began to replace the more familiar languages of that time like pl/I, algol etc.


no one pushed c . it wasn't made the official bell labs language.


Which program will execute faster c language or visual basic 6.0?

i want to re-write c program in visual basic 6.0


because i have to call the c program in visual basic


so instead of calling in vb i want to write same progtam c program in vb. Is it feasible or slows down the execution


please suggest

Which program will execute faster c language or visual basic 6.0?
Well, i can't see a VB program ever running faster than a C Program, although, this may be so small that it is pointless to worry about it. However, seeing that you have to execute it from VB anyway, it will probably be faster to just have VB run it. (Time to start the C Program) This difference maybe so small that it doesn't matter, it depends on how big these programs are.
Reply:there won't be much performance degradation.

easter cards

Help writing this in C language?

a) Define a struct called Student that includes an ID number (an integer), units (a double), and GPA (a double).



























































b) Declare a 30-element array of Student structs called class.





























c) Write a C statement that will print the GPA of the Student at index 14 of the class array.

















d) Write a function named inputStudent that will enter each field of a Student struct, and then return that struct.

Help writing this in C language?
c


Can i learn c language myself from any book?

the book language easy to undersatand .i am marathi person

Can i learn c language myself from any book?
yes you can learn c from kerningham and ritchie's C book


you should practice coding as much as you can.
Reply:You can learn C, but not from any book. I've found learning C using the koran is kinda hard.


Category: Computer Programming Basics.. Is Knowledge of C language required to Learn C++. Kindly Help, Thanks.

I am a software programmer. I had this dilemma b'coz we had learnt C++ after learning C. But is this a necessary thing to pass on the same culture to the newcomers. Is it essential to learn C before learning C++. Please help me, Thanks in advance.

Category: Computer Programming Basics.. Is Knowledge of C language required to Learn C++. Kindly Help, Thanks.
Since the C++ language contains all of the C language, it seems pointless to even look at this topic from this perspective. A person learning C++ will learn C (in a sense) anyway. True, they won't know which parts are C and which are not. For that reason, it might be a good idea to give them a small taste of what C is but I would not relegate them to a year of C programming before moving on. It isn't a promotion path.


In terms of what to pass on, I would say, worry mostly about what is today. We don't teach them FORTRAN before learning C do we?


Furthermore, someone new starting out should only be taught one thing to start. Once they get the concepts, then they can branch out to other languages.
Reply:Dude C is procedural language.


C++ is object like language.





There is no problem to study C++ and C knowledge is not at all necessary.








Enjoy!!!
Reply:It's helpful if you have knowledge, so you could cite their similarities and differences, however since your asking if it's a requirement ,then i would say not really. As long as you can do, read and analyze codes...that would be a great start. Goodluck!
Reply:Try c# then c then c++. C++ is like learning to speak chinese its going to be really hard.
Reply:No, Because these two languages are into different arena.





But if you know C Already, then Learning c++ would be some what easier because some of the keywords and language constructs are same in C and C++.


Thursday, July 30, 2009

Help writing this in C language?

a) Define a struct called Student that includes an ID number (an integer), units (a double), and GPA (a double).



























































b) Declare a 30-element array of Student structs called class.





























c) Write a C statement that will print the GPA of the Student at index 14 of the class array.

















d) Write a function named inputStudent that will enter each field of a Student struct, and then return that struct.

Help writing this in C language?
whitespaces can be very confusing and annoying. I can and do annoy in the opposite way, but it's easier when we can read more than one letter without scrolling.





I'll just put in answers without checking them (on GCC which means I won't be using any nonstandard syntax like conio.h anyhow).





a.


typedef struct student{


int ID;


double units;


double GPA;


} Student;


b.


Student class[30];


c.


printf("The GPA of student 14 is %f.\n", (class[14].GPA));





d.





Student inputStudent(){


Student temp;


int identification;


double Units, Average;





printf("Enter Student ID:");


scanf("%d", %26amp;identification);


printf("Enter Student Units:")


scanf("%f", %26amp;Units);


printf("Enter Student GPA:");


scanf("%f", %26amp;Average);





temp.id=identification;


temp.units=Units;


temp.GPA=Average;





return temp;


}





call with class[i]=inputStudent();

brenda song

List of problems in Program in C-Language. [Can you help me ?]]?

problem 1.


Write a program in C that reverse the input number N. Formulate an equivalent come up with the answer.


Same input/output dialogue:


Enter a number : 1238 ----Input data


Reverse number: 8321 ---Output data


Solution: Use do-while Statement.





Problem 2.


Write a program in C that will scan a number N and then output


the sum of the powers from 1 to N. thus, if the input is 4, the output should be 288 bec. 1+4+27+256=288 [1,2,3,4]


Solution: Use for do statement.





Problem 3:


Write a program in C that accepts dates written in numerical form and then output them as a complete form.


Sample input: 2 26 1986


Sample output: February 26, 1986.


Solution: use if/else if/ else statement.





Program 4:


Write a program in C that will calculate the sum of the sequence number from 1 to N. Thus, if the input is 6, then the output should be 21 because 1+2+3+4+5+6=21.


solution: use while statement.

List of problems in Program in C-Language. [Can you help me ?]]?
Problem 1:





#include %26lt;stdio.h%26gt;





int main() {


int n;


scanf("%d", %26amp;n);


while ( n%26gt;0 ) {


int k = n%10;


printf("%d",k);


n = n/10;


}





return 0;


}





Problem 2:





#include %26lt;stdio.h%26gt;





int main() {


int n;


long s = 0;


scanf("%d", %26amp;n);


for (int i=1; i%26lt;=n; i++) {


int k = 1;


for (int j=1; j%26lt;=n; j++) k=k*i;


s = s + k;


}


printf("%d\n", s);


return 0;


}





Problem 3:





#include %26lt;stdio.h%26gt;





int main() {





int d,m,y;


scanf("%d %d %d", %26amp;d, %26amp;m, %26amp;y);





if ( m == 1 ) printf("January %d, %d\n", d, y);


else if ( m == 2 ) printf("February %d, %d\n", d, y);


else if ( m == 3 ) printf("March %d, %d\n", d, y);


else if ( m == 4 ) printf("April %d, %d\n", d, y);


else if ( m == 5 ) printf("May %d, %d\n", d, y);


else if ( m == 6 ) printf("June %d, %d\n", d, y);


else if ( m == 7 ) printf("July %d, %d\n", d, y);


else if ( m == 8 ) printf("August %d, %d\n", d, y);


else if ( m == 9 ) printf("September %d, %d\n", d, y);


else if ( m == 10 ) printf("October %d, %d\n", d, y);


else if ( m == 11 ) printf("November %d, %d\n", d, y);


else if ( m == 12 ) printf("December %d, %d\n", d, y);





return 0;


}





Problem 4:





#include %26lt;stdio.h%26gt;





int main() {


int n;


int s = 0;


scanf("%d", %26amp;n);





while (n%26gt;0) {


s=s+n;


n--;


}


printf("%d\n", s);





return 0;


}


For all C language masters..................?

After installing my Turbo C of version 3.0 ,when i type any program it is refusing to accept........while compiling it shows the result that it couldnt identify the header file(#include%26lt;stdio.h%26gt;)...........

For all C language masters..................?
The compiler checks the INCLUDE environment variable, for a list of paths in which to search for any #include'd files delimited in angle brackets. The file stdio.h must exist in one of those listed paths.





So type SET at a command prompt, which will display all environment variables and their contents. If there isn't one called INCLUDE, you may need to run a batch to setup the environment before calling the command-line version of the compiler. (VC includes such a batch; the INCLUDE environment thing is generic.)


Program in C language to add 2+4+8+....?

Please help me how to write a program in C to find sum of 2+4+8+....to 2 raised to power n using recession

Program in C language to add 2+4+8+....?
This uses recursion


#include %26lt;math.h%26gt;


unsigned int findSum(unsigned int n);





main()


{


int n = 3;


printf("%d\n",findSum(n));


}





unsigned int findSum(unsigned int n)


{


if(n == 0)


return 0; //this should be 1 since pow(2,0) is 1 but u asked 2+4+...ok


return (pow(2,n) + findSum(n-1));


}








please use -lm option to link with math.h since i used pow() function.


gcc xxx.c -lm
Reply:#include%26lt;stdio.h%26gt;


main()


{


int n,i,j,x,y;


printf("Number: ");


scanf("%d",%26amp;n);


for(i=0;i%26lt;=n;i++)


j=2n;


for(y=0;y%26lt;=j;y++)


x=y+j;


printf("sum: %d",x);


return 0;





}
Reply:If you want to have 10 members (else change thenumber 10)





int r=0;


int b=1;


for (i=1;i%26lt;=10;i++)


{


r+=b;


b=2*b; //or use shift command


}
Reply:Ok, this is a simple program to design so dont worry about it. First you'll need a variable called SUM which will contain the sum and through a for loop(from 1 to N) we'll increment the sum ... anyway heres the code, I've done it with C++, but you can switch it to C





int main()


{


//the sum


int sum;





//n - the inputed number-..


int n;


cin%26gt;%26gt;n;





//starting from 2 increment i by 2..which is 2, 4, 6...


for(int i = 2;i%26lt;n;i+2)


{


sum+=i;


}





//print the results out


cout%26lt;%26lt;sum;





}
Reply:for(int i=num;i%26gt;=1;i--)


{


sum += 2%26lt;%26lt;i;


}


sum +=2;





I hope this is the answer you are looking for


If know C language then solve it.....?

write a program to transform its input according to a specified transformation scheme. the transformation scheme will consist of two strings: a string of character and then a string of replacement characters. the idea is that your program replaces every instance of the ith character in the initial string with the (i+3) character (of english alphabets) in the replacement string. when no substitution is defined for a character , the program just passes it through to the output unchanged. The program should inform the user of any errors in the transformation scheme. Your program should display the phrase before and after the substitutions have been made.





example : This is a C program.


string after the transformation : Wklv lv d f Surjudb.

If know C language then solve it.....?
Here is a source code i have enclosed below.Copy and paste it in a new text file and compile it.





If it is not upto your needs dont worry . Contact me at m_gopi_m@yahoo.co.in. I really like to program like this.





But time doesn't support me and i was not able to understand the question clearly. So if you want contact me and i can design new program.





Here the source begins.......





/*


Please create a new folder and place this program in it. It creates


Two text documents(first.txt and second.txt).





first.txt is a copy of the input stream.


second.txt is a copy of encryption.


repalaces ith term by i+3 terms.





Please do not use any special keys like delete,backspace etc...





If you want to change the encryption number. Change 'num' variable(int)


present at 23:14.


*/








#include%26lt;stdio.h%26gt;


#include%26lt;conio.h%26gt;





void main()


{


FILE *fp1,*fp2;


char a,b;


int num=3,i;





clrscr();


printf("\n\nEnter your message:\n%26lt;When you do so press enter%26gt;");


printf("\n%26lt;Please avoid special characters%26gt;\n\n\t");





fp1=fopen("first.txt","wt+");


while(a!=13)


{


a=getche();


if(a==0)


{


getch();


printf("\b\a");


}


else if(a==8)


{


printf("%c\a",b);


}


else


{


fputc(a,fp1);


b=a;


}


}


rewind(fp1);





fp2=fopen("second.txt","wt+");


while(a!=EOF)


{


a=fgetc(fp1);





if(a!=EOF %26amp;%26amp; a!='\0')


{


if(a!=' ')


a+=num;


fputc(a,fp2);


}


}


fclose(fp1);





rewind(fp2);


clrscr();


printf("\nThe resultant text is\n\n\t");





a=' ';


while(a!=EOF)


{


a=fgetc(fp2);


printf("%c",a);


}





gotoxy(1,22);





for(i=0;i%26lt;68;i++)


printf("%c",205);


printf("\nFor convenience the input data is saved in first.txt");


printf("\nThe encrypted data is saved in second.txt");


printf("\nPlease take a view at it.");





getch();


fclose(fp2);


}
Reply:That's not a hard task.


All we need is an array, or you can called: matrix.


In ANSCI behind every character there is a number.


For example: A-97,B-98(just assume, i dont have a manual now on hand), then you should design a number array, such as : {1,2,5,6}, then you could process the string with such method: the first charac. add the array[1], then the second add the array[2], and make a simple recycle, to let the string to add the members of array in a round turn.


Relly simple, right?
Reply:i will not write program for u.





But make an array of 26 characters.





take every character from given string and get the position no.


then add two and get the string





Do it untill all the characters completed.


And yes dont forget to skip to 1 if count increase to 26.





simple.

bouquet

Programmer in C# language?

please i want any one who are good in C# to help me?


but i want her email pleaaaaaaaaaaaase

Programmer in C# language?
I'm good with C#... send me a message about your intentions.


I am good in my C/C++ language,Is there any certification exams for C/C++?

What is meant by proficiency in C/C++?


Give me the online links for it....


For JAVA there is Sun microsystems certification,like that for C/C++???

I am good in my C/C++ language,Is there any certification exams for C/C++?
check on borland web they do offer c and c++ certifications
Reply:you can check brainbench certifications.


Importance of C Language?

About Computer Language

Importance of C Language?
w/o C


millions will be jobless
Reply:It depend to your what language you using it.
Reply:Most of the core software on this planet is written in the C programming language.





This includes the Windows, Unix and Macintosh operating systems, and many embedded systems.





C is a really simple language to implement on any microprocessor. It is normally the first one to be implemented on a new processor, often using a cross-compiler.





Most interpreted and compiled languages such as Java, PERL, etc. are implemented in C for portability. So if you program in one of these languages, you are actually running on a C base.


Please help me in C language?

1. What are the programming process?


2. Components of C


3. Features %26amp; Characteristics of C


4. C Program Structure


5. Preprocessor Directives


6. Declaration Section


7. Executable Section


8. Comment, Remakrs %26amp; annotations


9. Keywords, Data Types %26amp; Constants


10. Rules in naming variavbles %26amp; constants


11. assignment %26amp; calculations








please help me.. lady_joy024@yahoo.com

Please help me in C language?
What you are asking would be a semester course in college Computer Science. Go to your favoriite book store, and try to find a book, one of those ... For Dummies, or something like that. Something that starts you off very simply, and may or may not include a compiler disk, depending on the cost.





If you have programmed before, you may not need a book at all, but for beginners it can be hard.





Try, if you have time for online study, free:





http://cplus.about.com/library/blctut.ht...





or with your favorite search engine, for:





c manual programming beginner





And, you should get around 7 millions hits.
Reply:Wow. Thanks for posting your homework assignment up in broken english. I'll make sure I get right on that!
Reply:Go to prydain.futurecis.com and click on utilities. They have a quick down and dirty C guide
Reply:you need a C text book.
Reply:ask a single question?????????


don't ask like this

yu gi oh cards