Saturday, July 6, 2013

Stuck Need ! NOOb here

I need to create a program
that does this v

A permutation is one of several possible ways in which you can order or arrange a group of things. Write a program that displays a new random permutation of the integers 0 to 9 at the request of its user. For example, the program’s output could be as follows:
1237894560
Another permutation? yes
65310974280
Another permutation? no
Bye!

Your program should prints how many 7 was printed when user type no.

I got only up to here

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void)
{
char ch;
srand(time(NULL));
do{
printf("%d\n", rand());
if(i=7)

printf("would you like to print again Yes OR No:");
fflush(stdin);
scanf("%c",&ch);
printf("====>>>%c\n",ch);

}while ( ch=='Y' || ch=='y');

printf("Bye!\n");

return 0;


Help my solve this :) - Full Post

No comments:

Post a Comment