answersLogoWhite

0

AllQ&AStudy Guides
Best answer

mowing

This answer is:
Related answers

mowing

View page

Katya Wyeth was born on January 1, 1948, in Germany.

View page

Here is the code to do it:

#include<stdio.h> main() { int n, c, k, space = 1; //Here we ask for the number of rows would be : printf("Enter number of rows\n"); scanf("%d",&n); space = n - 1; //This is the first half of the diamond for ( k = 1 ; k <= n ; k++ ) { for ( c = 1 ; c <= space ; c++ ) printf(" "); space--; for ( c = 1 ; c <= 2*k-1 ; c++) printf("*"); printf("\n"); } space = 1; //Here is the second half of the diamond for ( k = 1 ; k <= n - 1 ; k++ ) { for ( c = 1 ; c <= space; c++) printf(" "); space++; for ( c = 1 ; c <= 2*(n-k)-1 ; c++ ) printf("*"); printf("\n"); } return 0; }

Hope that helped :)

View page
  1. #include
  2. #include
  3. void main()
  4. {int a[10],i=0,c=0,n;
  5. printf("\n enter the gray code");
  6. scanf("%d",&n);
  7. while(n!=0)
  8. {a[i]=n%10;
  9. n/=10;
  10. i++;
  11. c++;
  12. }
  13. for(i=c-1;i>=0;i--)
  14. {
  15. if(a[i]==1)
  16. {
  17. if(a[i-1]==1)
  18. a[i-1]=0;
  19. else
  20. a[i-1]=1;
  21. }
  22. }
  23. printf("\n the binary code is");
  24. for(i=c-1;i>=0;i--)
  25. printf("%d",a[i]);
  26. getch();
  27. }
View page

James (Jamie) Wyeth is one of Andrew Wyeth's two sons.

View page
Featured study guide
📓
See all Study Guides
✍️
Create a Study Guide
Search results