Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int Id(int num)
- {
- int row, col;
- for (row = 0; row < num; row++)
- {
- for (col = 0; col < num; col++)
- {
- if (row == col)
- printf("%d ", 1);
- else
- printf("%d ", 0);
- }
- printf("\n");
- }
- return 0;
- }
- int main()
- {
- int size;
- printf("Enter the size: ");
- scanf("%d",&size);
- Id(size);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement