C program- using visual studio code.
Write a program that asks for an integer and then prints all the alternative integers from (and including) that value up to (and including) a value larger by 20. (That is, if the input is 5, the output runs from 5 to 25.) Be sure to separate each output value by a space or tab
c program and output is attached as screenshot
------------------------------------------------------------------------
#include <stdio.h>
int main()
{
int n,i;
printf("enter interger\n");
scanf("%d",&n); // enter any interger
for(i=n;i<=n+20;i+=2) loop print every alternate
interger
printf("%d\t",i);
return 0;
}
Get Answers For Free
Most questions answered within 1 hours.