print square of first 10 even numbers
Answers
Answered by
2
Hope it helps u. Please mark me as Brainlist.
Attachments:
Answered by
1
This program prints n even numbers(not just 10) :
#include <stdio.h>
int main()
{
int i, n;
// Input upper limit of even number from user
printf("Print all even numbers till: ");
scanf("%d", &n);
printf("All even numbers from 1 to %d are: \n", n);
while(i<=n)
{
/* Check even condition before printing */
if(i%2==0)
{
printf("%d\n", i);
}
i++;
}
return 0;
}
Similar questions
Geography,
3 hours ago
English,
3 hours ago
Social Sciences,
3 hours ago
Math,
5 hours ago
Science,
8 months ago
Social Sciences,
8 months ago