Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


WAP to display 1,2,3,4,5........N

Answers were Sorted based on User's Feedback



WAP to display 1,2,3,4,5........N..

Answer / sreejesh1987

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("\nEnter n:");
scanf("%d",&n);
for(i=1;i<=n;i++)
printf("%d ",i);
getch();
}

Is This Answer Correct ?    11 Yes 3 No

WAP to display 1,2,3,4,5........N..

Answer / arti sharma

void main()
{ int i,n,k;
printf("enter the limit");
scanf("%d",&n);
k=1;
i:
if(k<=n)
{ printf("%d",k);
k++;
goto i;
}
getch();
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C Code Interview Questions

Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];

1 Answers  


Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }

1 Answers  


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)

7 Answers   Microsoft,


&#8206;#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }

2 Answers  


void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }

1 Answers  


Finding a number which was log of base 2

1 Answers   NetApp,


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }

1 Answers  


main() { static int var = 5; printf("%d ",var--); if(var) main(); }

1 Answers  


What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }

1 Answers  


main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }

1 Answers  


Categories