C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(void) {
int num;
int i;
printf("Enter a positive number :");
fflush(stdout);
scanf("%d",&num);
while ( num<0){
printf("Enter a positive number :");
fflush(stdout);
scanf("%d",&num);}
for(i=0; i<num; i++){
if(i % 2 !=0 && (int)sqrt(i)==sqrt(i))
printf("%d ",i);//the compiler here does not take an another input , but it worked well on my IDE^^
}
return 0;
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run