406 Posted Topics
Re: Firstly... [code=syntax] for(b=0,b<=a,b--) { printf("The Numbers in Descending order:%d\n",b[a]); } [/code] is wrong.As you can see you are starting b's count from 0 and doing a b-- operation. Secondly... You need some sorting mechanism to sort your arrray.The simplest to understand may be selection sort to start with. | |
Re: [QUOTE=lonely_girl;792050]ok i need a little guide about my program.. How i take my start? taking the current year,current month,current date,birth year, birth month, birth date input and giving the age in the form of "years-months-days" suppose "18 years-2months-21days"...[/QUOTE] You can take "18-2-21" as a string input into string str and … | |
Re: In my view the usage 'echo helloworld > newfile.txt' within a 'C' program is limiting the redirection operator and as a result it is also being treated as as a simple '>' text character, which on echo prints the output 'helloworld > newfile.txt' to the stdout. You need to look … | |
Re: Loops are always better than goto but with goto I think this can be done: You may also use another variable by the name cnt which would hold the number of times you want to re-run the program in case of a wrong input symbol and alter the code as: … | |
Re: [QUOTE=sarawilliam;789986]Hi I want to know how we can measure C execution time by seeing the clock cycles generated from the assembly code. Thanks...[/QUOTE] I cannot assure you of this method but it had worked for me.The time.h header file has some variables as CLK_TCK and a data type which you … | |
Re: All these cant be done in scanf itself so you can make some changes in ur prog to implement them n then move forward which would give the image as if the input is so.... #include<stdio.h> #include<ctype.h> int main(void) { char str[15]; scanf("%[^\n]",str); str[0]=toupper(str[0]); str[15]='\0'; printf("%s",str); return 0; } |
The End.