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 >> Software >> Programming Languages >> C
 
 


 

 
 C interview questions  C Interview Questions (2265)
 C++ interview questions  C++ Interview Questions (1119)
 VC++ interview questions  VC++ Interview Questions (342)
 Delphi interview questions  Delphi Interview Questions (510)
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions (648)
Question
1. Write a c pgm to print 1 to 100 without using loops.
2. Write a c pgm for leap year  
3. Write a c pgm fibbonacci series,factorial
4. Write a c pgm count no of lines , blanks, tabs in a 
para(File concept) 
5. Write a c pgm to print the letter as per given condition
      i.e.. if u give 4
    out put should b 
    4 4 4 4
    4 4 4 4
     4 4 4 4
    4 4 4 4
6.how do get the o/p in number from 1 to 100 in the screen 
without using    control statement?
7. who do u print the word "hello world" without using 
"printf" statement?
8. write sql program to get the detail of student in a 
class?
     Definitions:
     structure
     union
     arrays 
     linkedlist
     macros
     directives
     difference b/w 
    pre processorsDiffrence:
1.Constructors and destructors 
2.Structure and Union
3.Array and Lists
4.pre processor...
5. Privillages in C++
6.structure and union 
7.break and continue 
8.while and dowhile Pgm..
 Question Submitted By :: C
I also faced this Question!!     Answer Posted By  
 
Answer
# 1
1) 1 -100 without looping....

#include<stdio.h>
#include<conio.h>
int i=1;
void main()
{
i<=100 ? printf("%d\n",i) : getch(); //conditional operator
i++;
main(); //recursive calling of main() function
}


7) printing a string without printf()

#include<stdio.h>
#include<conio.h>
void main()
{
if(printf("hello world"))
getch();
}

5) printing ur sequence

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

6) printing 1-100 without using loops as well as control statement...

same answer which i have made for your QUESTON 1... and conditional operator is not a control statement...

3) a) very basic and simple logic fabbonacci series:

#include<stdio.h>
#include<conio.h>
void main()
{
int a=1,b=-1,c,n;
printf("enter the no. of terms :");
scanf("%d",&n);
for(int i=1;i<=m;i++)
{
c=a+b;
printf("%d\n",c);
b=a;
a=c;
}
getch();
}

b) Factorial :

#include<stdio.h>
#include<conio.h>
void main()
{
int m,j=1;
printf("enter ur number :");
scanf("%d",&m);
for(int i=1;i<=m;i++)
j=j*i;
printf("the factorial is : j");
getch();
}

remaining i ll answer today evening....

thank u
 
Is This Answer Correct ?    39 Yes 13 No
Vignesh1988i
 
Answer
# 2
5.
void main()
{
int n,i,j;
printf("Enter the number");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
printf("%d\t",n);
}
printf("\n");
}
getch();
}
 
Is This Answer Correct ?    22 Yes 7 No
Karna
 
 
 
Answer
# 3
8:ANSWER
#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,n;
printf(“enter the n value:);
scanf(“%d”,&n);
while(n>i)
{
printf(“this is while condition programe”);
}
getch();
}
 
Is This Answer Correct ?    10 Yes 5 No
Antony Btitto
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
write a C and C++ programme to implement the A,bubble sort B,quick sort C,insertion sort D,sequential search E,binary search TCS 1
how to write hello word without using semicolon at the end? Accenture 5
for(i=1;i>0;i++); printf("i=%d",i); what will be the answer????   7
WHAT IS ABSTRACT DATA TYPE Wipro 4
what is the diff b/w static and non static variables in C. Give some examples plz. Wipro 3
How can we open a file in Binary mode and Text mode?what is the difference? PanTerra 1
i want to have a program to read a string and print the frequency of each character and it should work in turbo c Persistent 3
WAP to accept first name,middle name & last name of a student display its initials? NIIT 5
6)What would be the output? main() { int u=1,v=3; pf("%d%d",u,v); funct1(&u,&v); pf("%d%d\n",u,v); } void funct1(int *pu, int *pv) { *pu=0; *pv=0; return; } a)1 3 1 3 b)1 3 1 1 c)1 3 0 0 d)1 1 1 1 e) 3 1 3 1   4
what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error Infosys 9
How would you find a cycle in a linked list? NSN 3
what is difference between userlevel threads and kernel level threads ?what are the trades offs between these two approaches ? what approach is most frequently used and why ?   1
 
For more C 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