Write a c program using for loop in switch case?
Answer / mmm
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
int code;
clrscr();
printf("menu\n");
printf("\npress 1 for positive numbers");
printf("\npress 2 for negitive numbers");
printf("enter code(1or2)");
scanf("%d",&code);
switch(code)
{
case 1: printf("\nfirst 10 positive numbers:");
for(i=0;i<10;i++)
printf("%d\n",i);
break;
case 2: printf("\nfirst 10 negative numbers:");
for(i=0;i<10;i++)
printf("-%d\n",i);
break;
default:printf("invalid code");
}
// printf("do you want to continue:yes or no");
getch();
}
Is This Answer Correct ? | 41 Yes | 2 No |
what will be the output of "printf("%d%d",scanf("%d% d",&a,&b))".provide an explation regarding the question
Explain zero based addressing.
what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?
What is c programming structure?
Why structure is used in c?
What is %g in c?
What are the disadvantages of a shell structure?
#include<stdio.h> main() { int i=5; printf("%d",i*i-- - --i*i*i++ + ++i); } tell the answer with correct reason .specially reason is important nt answer ans by turbo c is -39
What is data structure in c language?
What is a good data structure to use for storing lines of text?
What is the meaning When we write "#include" what is # and what does include does there???
write a program which counts a product of array elements lower than 10.