How can i find first 5 natural Numbers without using any
loop in c language????????
Answers were Sorted based on User's Feedback
Answer / vaishno
main()
{
int i=1;
printt:
printf("%d\n",i++);
if(i<=5)
goto printt;
getch();
}
Is This Answer Correct ? | 16 Yes | 5 No |
Answer / i.c.jacobpaul
main()
{
int i=1;
printt:
printf("%d\n",i);
i++;
if(i<=5)
goto printt;
getch();
}
Is This Answer Correct ? | 1 Yes | 6 No |
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,
How we print the table of 2 using for loop in c programing?
how to return a multiple value from a function?
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
Find the largest number in a binary tree
main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)
find A^B using Recursive function
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,