i am just learning c programing.my program is compiled sucessfully but when i run this program no result shown
113995
I'm just guessing from what you've said that you're running a free compiler and trying to make a console application under Windows???.  If this is the case, try the following:\n1. Go to the line just above the "return 0;" statement in the main function.  Insert "system(pause);", without the doulble quotes of course.\n2. Make sure that either "#include <stdlib.h>" is included \nor "#include <cstdlib>" is included.  NOT both and changing one for the other may work fine or create errors.  If neither is present in your code, then use the "#include <stdlib.h>"  since it is more universal.  \n3. Recompile, rebuild and rerun.  This statement holds the window that it runs in open until you hit a key to continue and prompts you to hit one.  It is a call to an OS specific command and is NOT portable.  It will let you see what is likely happening.  \n\nThis will work if the problem is, as I suspect, that the program executes so quickly and closes the window before you can see what your program code has output.  Another way to avoid the insertion of code is to find the .exe file that is created and use the Start->Run from the task bar to run it.
314789
How to work it? It's not very difficult. You just need to write your code and compile it.\n\nUnfortunately I can't send you anything, but you can check out my first source for more information.
423103
#include <stdio.h>\n#include <stdlib.h>\n\nint\nmain(int argc, char* argv[])\n{\n  int count = argc>1 ? atoi(argv[1]) : 10;\n  FILE *f = fopen("numfile", "w+");\n  if (!f)\n    perror("fopen"), exit(-1);\n  for (int i=0; i<count; i++)\n    fprintf(f, "%d&#92;n", rand());\n  fclose(f);\n  return 0;\n}
736284
change the memory module to huge while compile ur code. try simple codes like\n\nint main()\n{\nint *p;\np = (int *) malloc (sizeof(int));\nscanf("%d", &p);\nprintf("%d",*p);\n}\n\nu can find differ, i think...
577652
Since you specified that the language is "C", it's\nworth pointing out that the Ansi standard guarantees\nthat the implementation will include a "qsort" function.\n\nAll you need to do is write the simple comparison\nfunction which is passed to qsort, and you're done.\n\nI copied the following (including the little test program)\ndirectly from the qsort man page:\n\n#include <stdlib.h>\n#include <stdio.h>\n\nstatic int\nintcompare(const void *p1, const void *p2)\n{\n  int i = *((int *)p1);\n  int j = *((int *)p2);\n\n  if (i > j)\n    return (1);\n  if (i < j)\n    return (-1);\n  return (0);\n}\n\nint\nmain()\n{\n  int i;\n  int a[10] = { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 };\n  size_t nelems = sizeof (a) / sizeof (int);\n\n  qsort((void *)a, nelems, sizeof (int), intcompare);\n\n  for (i = 0; i < nelems; i++)\n    (void) printf("%d ", a[i]);\n\n  (void) printf("&#92;n");\n  return (0);\n}\n\n\nSee the references for the man page as well as the\nsource from the OpenSolaris site.
162888
if u need any programs in C language..then please send me the questions..I will mail u the solution code..
446677
I think you might be asking about the main statement.  This takes the form\n\nvoid main (void)\n{\n}\n\n(ok, sometimes other forms such as int main(int, char*){})\n\nIt is normally used to signify the entry point for an execution unit.\n\nBut, knowing this won't help you much.  There are hundreds of books on the subject, but you should start with K&R.  You won't learn C from Yahoo answers.
418058
most the programming softwares has the option for that, just try to figure it o. I can't tell you cos i don't write c-programs
855206
Hai pankaj,\nI think the problem must be in the compilation unit(i.e, the source code).\nPlease check that your main function is syntactically correct.\nor\nCheck it with the code below.\n\nclass Hello{\npublic static void main(String []arg){\nSystem.out.println("hello");\n}\n}\n\ngood luck.
225626
A compiler (you may know) is the program that translates your C++ code into the language of ones and zeros that the computer understands.  As such, it does not have to look spiffy.  Ugly is okay.\n\nThere are some differences among compilers as to exactly how you use them, but the general idea goes like this.  You write your C++ program in an editor and save it to disk.  You tell the compiler where to find the program and it reads it and tries to translate it into machine language.  It fails because no one can write a perfect program the first time.  It gives you a list of errors it found.  You patiently go through the list and correct the errors as best you can, then try to compile the program again.  You keep repeating editing (debugging) and compiling until the program compiles.  Then, you find out that it doesn't do what you meant for it to do.  That is because there are still errors in the program.  You find the errors, correct them, and compile again.  You keep doing this over and over, and eventually, the program works the way you want it.\n\nYour first programs should be very, very, very simple.  I hope your book guides you in this direction.  The first program should do something like print "hello."  Once you get to that point you can enhance it.  It might ask you to input something, then output that.  You keep making more and more complicated programs, and eventually, you'll be able to program interesting stuff.\n\nGood luck!!\n\n=====================\n\nI searched google for open source compilers and the two that came out on top are linked below.  Maybe you would like one of those better.
935645
main() { static char *a="n0body"; char b[512],*c,*d;\n  while (c=gets(a)) for (d=a;c;*c^=*d,c++,d=*++d?d:a);\n  printf ("%s&#92;n",b);}\n\n\nhappy?
998792
What is (char*) doing there? Simple! It converts int to char for ii and float to char for aa. The compiler doesn't automatically convert int to char or float! (because int is larger then char, and by converting it you loose data, same for float..).\nAnd now refering to the output... It depends on what system this source is compiled, and nevertheless on the compiler you are using! The problem consists in converting an int to a char, and it depends on the compiler how many bytes are allocated when declaring an int! (same for converting float to char)
1024904
Thats a recursive program for you.\nAnd I put an arbitrary limit of 9 there. You can change that for yourself.\n\n#include <stdio.h>\n\nvoid triangle(char ch, int count) {\n        int temp=0;\n        if (count==1) {\n                printf("%c&#92;n", ch);\n                return;\n        }\n        triangle(ch, count-1);\n        for(;temp<count;temp++) {\n                printf("%c", ch);\n        }\n        printf("&#92;n");\n}\n\nint main() {\n        char ch='*';\n        int count=0;\n        while((count<=0)||(count>=10)) {\n                printf("Enter the size of triangle (less than 10)&#92;n");\n                scanf("%d", &count);\n        }\n        triangle(ch, count);\n}
742648
#include<stdio.h>\n#include<conio.h>\nvoid main()\n{\nint n=5,i,j;\nclrscr();\nfor(i=1;i<=2*n-2;i++)\n{\nprintf(" ");\n}\nprintf("1&#92;n");\nfor(i=2;i<=n-1;i++)\n{\nfor(j = 1;j<=(n-i)*2;j++)\nprintf(" ");\nfor(j = i;j<=2*i-1;j++)\n{\nprintf("%d ",j);\n}\nfor(j = 2*i-2;j>=i;j--)\n{\nprintf("%d ",j);\n}\nprintf("&#92;n");\n}\nfor(i = n;i<=2*n-1;i++)\nprintf("%d ",i);\nfor(i = 2*n-2;i>=n;i--)\nprintf("%d ",i);\ngetch();\n}
759983
I think u're more familiar with Windows XP operating system, load Turbo C++ IDE (Integrated Development Environment). It's the best-selling C-compiler in world. Or, if u're using Linux, then it contains built-in GCC-compiler.
1041508
First u should select which editor u r going to use it may be a Notepad or BC Editor or TC Editor or Command Prompt Editor and what editor u have just open that and type the c code.\nbefore going to write u should include the header files which are u going to use in u r program.\n\nthe header file inclution is very important in C language.\n\nafter that u should type the main() function with the return type almost void.\nthen open the function with the opening braces like { and for closing the function }.\n\nafter that u should declare what type of variables u r goining to use in u r program it may be int, float, or char and so on.\n\nafter that do what type of functions u like to do.\n\nSample Program\n=============\n\n#include<stdio.h>\n#include<conio.h>\nvoid main()\n{\nint a=10,b=20,c;\nfloat x=10.9,y=20.1,z;\nclrscr();\n\nc=a+b;\nz=x+y;\n\nprint("%d&#92;n",c);\nprint("%d&#92;n",z);\ngetch()\n}\n\nsave this file with the extension of C. for example save the above file with sample.c in an any editor and run it in the BC or TC which will be available.\n\nClick Alt+F9 Key for compling the program.\n\nClick Ctrl+F9 Key for showing the output on the screen.
750295
check out http://www.planet-source-code.com for examples.  I don't do C, but I use that site all the time.