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...


program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5

Answers were Sorted based on User's Feedback



program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / dhruv sharma rkdf

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

Is This Answer Correct ?    3 Yes 0 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / ep

#include <stdio.h>

int main()
{

for ( int i = 1; i <= 5 ; i++ ) {
for ( int j = i; j <= 5 ; j++ ) {
if ( i != j ) printf (" ");
printf( "%d", j );
};
printf("\n");
}

return 0;
}

Is This Answer Correct ?    1 Yes 0 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / jayaraj.s

#include <stdio.h>
main()
{
int a,b,i=1;
for(a=i;a<=5;a++)
{
for(b=a;b<=5;b++)
{
printf("%d",b);
}
printf("\n");
i++;
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / dhruv sharma rkdf

hello Jayaraj.s..........
your program will give the following compilation error:
"getch should have a prototype"

you need to include "conio.h" header file...

Is This Answer Correct ?    0 Yes 0 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / atul shukla

#include<stdio.h>
void main()
{
int i,j;
for (i=1;i<=5;i++)
{
for(j=i;j<=5;j++)
printf("%d ",j);
printf("\n");
}
}

Is This Answer Correct ?    0 Yes 0 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / letskools

I think th correct program is this for the above output
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();

for(i=0;i<=5;i++)
{
for(j=i;j<=5;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    2 Yes 3 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / rajarshi bhadra

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();

for(i=5;i>=0;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}

Is This Answer Correct ?    4 Yes 7 No

program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5..

Answer / subasaranya

1 2 3 4 5
2 3 4 5
3 4 5
4 5
5

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C Interview Questions

Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning

4 Answers   Accenture,


How do I read the arrow keys? What about function keys?

0 Answers  


Where local variables are stored in c?

0 Answers  


Write a program to print “hello world” without using semicolon?

0 Answers  


What is the difference between a string and an array?

0 Answers  


enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above

8 Answers   HCL, Wipro,


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

0 Answers   Celstream,


When a c file is executed there are many files that are automatically opened what are they files?

0 Answers  


What is the purpose of Scanf Print, getchar, putchar, function?

3 Answers  


Draw a flowchart to produce a printed list of all the students over the age of 20 in a class .The input records contains the name and age of students. Assume a sentinel value of 99 for the age field of the trailer record

0 Answers   Wipro,


What is c basic?

0 Answers  


please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com

0 Answers  


Categories