Computer Science, asked by funnyrohitd274, 10 months ago

Write the coding for the following by using for...Next and while...wend loop:
To print the series @2@4@16@256
to print series 2%4%6%8%10%

Answers

Answered by waqarsd
5

Answer:

#include <stdio.h>

void main (){

for (int x=2;x <=256;x*=x)

printf ("%d",x);

}

#include <stdio.h>

void main (){

for (int x=2;x <=10;x+=2)

printf ("%d",x);

}

For n....

#include <stdio.h>

void main (){

int n,i=0;

printf ("Enter no. of iterations/n");

scanf ("%d",&n);

printf ("The series is/n");

for (int x=2;i <n;x*=x,i++)

printf ("%d ",x);

}

#include <stdio.h>

void main (){

int n,i=0;

printf ("Enter no. of iterations/n");

scanf ("%d",&n);

printf ("The series is/n");

for (int x=2;i <n;x+=2,i++)

printf ("%d ",x);

}

HOPE IT HELPS

Similar questions