ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
how can i get output like this?
1
2 3
4 5 6
 Question Submitted By :: Manojkumar
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how can i get output like this? 1 2 3 4 5 6
Answer
# 1
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=6;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch()
}
 
Is This Answer Correct ?    0 Yes 3 No
Karthickumar
 
  Re: how can i get output like this? 1 2 3 4 5 6
Answer
# 2
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
int ctr=1;
for(i=1;i<=4;i++)
{
printf("\n")
for(j=1;j<=i;j++)
{
printf("%d",ctr);
ctr++;
}
}
}
 
Is This Answer Correct ?    0 Yes 0 No
Manojkumar Challagundla
 
 
 
  Re: how can i get output like this? 1 2 3 4 5 6
Answer
# 3
#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the terms :");
scanf("%d",&n);
count=1;
for(int i=1;i<=n;i++)
{
 for(int j=1;j<=(i);j++)
  printf("%d ",count++);
printf("\n");
}
getch();
}


thank u
 
Is This Answer Correct ?    0 Yes 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
IS STRUCTURES CAN BE USED WITHIN AN ARRAY? Caritor7
1)which of following operator can't be overloaded. a)== b)++ c)?! d)<= Siemens10
how to add numbers without using arithmetic operators. TCS10
HOW CAN ADD OUR FUNCTION IN LIBRARY.  5
what is a static function Satyam10
if the address of a[1,1] and a[2,1] are 1000 and 1010 respectively and each occupies 2 bytes then the array has been stored in what order?  3
find a number whether it is even or odd without using any control structures and relational operators? Microsoft14
Which of the following are valid "include" formats? A)#include and #include[file.h] B)#include (file.h) and #include C)#include [file.h] and #include "file.h" D)#include <file.h> and #include "file.h" Accenture14
who did come first hen or agg Infosys12
why we shiuld use main keyword in C  5
what is compiler  5
how many argument we can pas in in a function CTS20
What is the result main() { char c=-64; int i=-32 unsigned int u =-16; if(c>i){ printf("pass1,"); if(c<u) printf("pass2"); else printf("Fail2");} else printf("Fail1); if(i<u) printf("pass2"); else printf("Fail2") } a)Pass1,Pass2 b)Pass1,Fail2 c)Fail1,Pass2 d)Fail1,Fail2 e)none IBM7
Given an unsigned integer, find if the number is power of 2?  4
what is the difference between getch() and getchar()?  5
how many error occurs in C language ? Wipro11
1 232 34543 4567654 can anyone tell me how to slove this c question  3
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y TCS3
helllo sir give me some information of the basic information the c as printf ,scanf , %d ,%f and why is the main use of these.  3
what are the uses of structure? HCL5
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com