can u post ur complete code..if the below is not what u want..
if the input date is 180906 integer.
unsigned date = 180906;
char Date_in_DDMONYY[8];
int date_month = date / 100;
int month = date_month % 100;
int date = date_month /100;
int Digit_in_day = date /10;
int year = date%1000;
switch(Digit_in _day)
{
case 0:
Date_in_DDMONYY[0]...
User Profile
Collapse
Profile Sidebar
Collapse
Rakesh Mutharaju
Last Activity: Sep 22 '06, 04:53 AM
Joined: Sep 1 '06
Location: India
-
one small change..
in the method void print_num_in_en glish(int num)
string result is not printed.
before return; statment add cout<<result;Leave a comment:
-
sorry. But the initialization need not be in place [
for(initializat ion;condition;i nc/decre) ] if the variable is not altered or need to be reset.
#include<stdio. h>
#include<conio. h>
main()
{
int Line_number =1,maxnumber_of stars=6,StarsPe rLine=1;
clrscr();
for(;Line_numbe r <= maxnumber_ofsta rs;Line_number+ +)
{
for (;StarsPerLine <= Line_number;...Leave a comment:
-
Rakesh Mutharaju replied to pls guide me to write a program in c sort a linked list using selection sortin CTo add to this one more hint.,
PREVIOUS_NODE;
TEMP_NODE; //
TEMP_NODE->PTR = NEXT_NODE->PTR;
if(CURRENT_NODE->VALUE < NEXT_NODE->VALUE)
{
NEXT_NODE->PTR = PREVIOUS_NODE->PTR;
PREVIOUS_NODE->PTR = CURRENT_NODE->PTR;
CURRENT_NODE->PTR = TEMP_NODE->PTR ;
}
ALL the 4 TEMP_NODE,PREVI OUS_NODE,CURREN T_NODE,NEXT_NOD E...Leave a comment:
-
yes you are very much right.. i was just considering the case of the particular input which he has mentioned....Leave a comment:
-
Did you give a try?
that is a simrple task..
steps:
int Line_number =1,maxnumber_of stars=6,StarsPe rLine=1;
for(;Line_numbe r <= maxnumber_ofsta rs;Line_number+ +)
{
for (;StarsPerLine <= Line_number; StarsPerLine++)
{
printf("*");
}
printf("\n");
}
for the next sequence.. change the first for...Leave a comment:
-
to add something more..
a= a*b;
b=a/b;
a=a/b;
will also yeild the same desired output...!!Leave a comment:
-
int a, b;
a= 5;
b= 7;
a= a+b;
b=a-b;
a=a-b;
this will give the requied solution.. there are couple of more solutions to this..
the XOR suggested above is also correct.!! :)Leave a comment:
-
Banfa " Well I actually get 12 11 12" can you explain how this output is evaluated?
i got 12 11 11. i used a printf statement.
printf(" %d %d %d" ,i,i++,++i);
can you explain how the printf will be evaluated?Leave a comment:
-
Hey i give a clue.. u give a try urself.
consider
ptr [ current node after which u want to insert or delete]
ptrnew [ is the node to be inserted/deleted]
Insertion:
ptrnew->next = ptr->next;
ptr->next = &ptrnew;
deletion:
ptr->next = ptrnew->next;
free(ptrnew);
try with this clue.., :DLeave a comment:
-
#include<time.h >
#include<stdio. h>
#include<conio. h>
void main()
{
long time1;
struct tm strtm;
clrscr();
time(&time1);
strtm = *localtime(&tim e1);
printf(" \n time %ld",time1);
printf(" \n time.tm_sec %d ",strtm.tm_sec) ;
printf(" \n time.tm_min %d",strtm.tm_mi n);
printf("...Leave a comment:
-
#include<conio. h>
#include<string .h>
#include<stdio. h>
void main()
{
int i,j,ct=1;
char c,a[100];
clrscr();
printf(" Enter the string: ");
scanf("%s",a);
printf("\n string length %d \n",strlen(a) );
printf("Output :");
for(i=0;i<strle n(a);i++)
{
if( a[i]==a[i+1])
ct=ct+1;
...Leave a comment:
-
for the first question try doing this..
1. check for the reappearance of each char in the given string.
2. sort the list based on the char, check the value of the reappearance is well associated when you sort.
for the sencond question, small correction in the solution you have tired.
else
{
cout<<a[i]<<ct;//print out the previous letter along with ct
ct =1; // reset the...Leave a comment:
No activity results to display
Show More
Leave a comment: