program to print the series 0,3,8,15,24,35,48,63
Answers
Answered by
14
# include<stdio.h>
void main()
{
int i;
for(i = 1; i <= 10; i++)
{
printf("%d", i * i-1);
}
getch();
}
void main()
{
int i;
for(i = 1; i <= 10; i++)
{
printf("%d", i * i-1);
}
getch();
}
Answered by
3
Answer:
void main
{
int i , n, p ;
printf ( enter the value of n );
scanf ( " %d ", & n) ;
for ( i =1 ; i <= n ; i++ )
{
p = ( i ∧ 2 ) -1 ;
printf ( " %d " , p) ;
}
}
for loop is used when the number of iteration is known. Basically it is used when we do same work repeatedly.
printf is used for printing a message.
scanf is used for taking input.
Similar questions
Math,
8 months ago
English,
8 months ago
Math,
1 year ago
Political Science,
1 year ago
Sociology,
1 year ago