ALLInterview.com :: Home Page            
 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                      
Google
   
 
Categories >> ERRORS >> C C++ Errors
 
 


 

 
 C C++ Errors interview questions  C C++ Errors Interview Questions (62)
 DotNet Errors interview questions  DotNet Errors Interview Questions (14)
 Database Errors interview questions  Database Errors Interview Questions (16425)
 Scripts Errors interview questions  Scripts Errors Interview Questions (55)
Question
What is the code for following o/p
     *
    * *
   *   *
  *     *
 *       *
  *     *
   *   *
    * *
     *
 Question Submitted By :: C-C++-Errors
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
#include<stdio.h>

void main()
{
int i,j,k,num = 5;

for(i = num;i > 0;i--){
for(j = 1;j <= i;j++){
printf(" ");
}
for(k = (j - 1);k < num;k++){
if(k==j-1 || k==num-1)
printf("*");
else
printf(" ");
printf(" ");
}
printf(" \n");
}


for(i = num;i > 0;i--){
for(j = (num - i);j > 0;j--){
printf(" ");
}
for(k = 0;k < i;k++){
if(k==0|| k==i-1)
printf("*");
else
printf(" ");
printf(" ");
}
printf(" \n");
}
}
 
Is This Answer Correct ?    5 Yes 1 No
Unknown
 

 
 
 
Other C C++ Errors Interview Questions
 
  Question Asked @ Answers
 
Write a c-programe that input one number of four digits and find digits sum?   2
errors are known as? SBI 3
printy(a=3,a=2)   3
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }   4
how tally is useful?   2
Assume that the int variables i and j have been declared, and that n has been declared and initialized. Write code that causes a "triangle" of asterisks of size n to be output to the screen. Specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consistings of three, etc. The last line should consist of n asterisks. Thus, for example, if n has value 3, the output of your code should be * ** *** You should not output any space characters. Hint: Use a for loop nested inside another for loop. HCL 2
What is the out put of this programme? int a,b,c,d; printf("Enter Number!\n"); scanf("%d",&a); while(a=!0) { printf("Enter numbers/n"); scanf("%d%d%d",&b,&c,&d); a=a*b*c*d; } printf("thanks!"); getche(); Entering numbers are a=1,b=2,c=3,d=4 b=3,c=4,d=-5 b=3,c=4,d=0   2
#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); } HCL 9
Given that two int variables, total and amount , have been declared, write a sequence of statements that: initializes total to 0 reads three values into amount , one at a time. After each value is read in to amount , it is added to the value in total (that is, total is incremented by the value in amount ). Instructor's notes: If you use a loop, it must be a for loop. And if you use a loop control variable for counting, you must declare it. Google 1
difference between c/c++ programing language? what is necessesity of c++ when existing c programing language? TCS 2
when i use cout or cin call & then either << or >> .....it shows declaration syntax error...what should i do? cout<<"anything"; int a; cin>>a; return 0;   2
void main() { int i=5; printf("%d",i+++++i); } Hcl 12
 
For more C C++ Errors Interview Questions Click Here 
 
 
 
 
 


   
Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
   
Copyright 2013  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  KalAajKal.com