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 |
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
Which driver is a pure java driver
what is disadvantage of pointer in C
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
What is the purpose of ftell?
How many ways are there to swap two numbers without using temporary variable? Give the each logic.
What is the purpose of scanf() and printf() functions?
How can you determine the maximum value that a numeric variable can hold?
What is data structure in c and its types?
program to find which character is occured more times in a string and how many times it has occured? for example in the sentence "i love india" the output should be i & 3.
What is anagram in c?
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }