Hi everyone, i'm new here, and also new in InfoTech education (i'm a freshman student)


I don't really know what's the exact word for it, so it's pretty hard for me to search it in this forum but....


can anyone help me out?

how can i use WHILE in reversing numbers..?


say for example....


/*output/

Enter Number: 99873
Number in Reverse is: 37899

Recommended Answers

All 2 Replies

Hey,

My first post.

I didnt want to spoonfeed you but its really simple so here it is.
i have made some small errors intentionally which you will be able to fix once you understand the code.

#include <stdio.h>

void myreverse(char pass[21]);

int main(int argc, char  *argv[])
{
	char pass[21];
	strcpy(pass,argv[0]);
	int length = strlen(pass);
	printf("length is %d\n", length);
	myreverse(pass);
    return 0;
}


void myreverse(char pass[21])
{
	int i = 0;
	strrev(pass);
	printf("reversed string is %s\n",pass);
}

Regards
Sameer

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.