You are here:

C/help plz

Advertisement


Question

hi
can you help me about this program i don't know why its printf doesn't work can you help me plz

#include<stdio.h>
void main(){
int n,i=0,j=0,num;
printf("Enter n:\n");
scanf("%d",&n);
printf("enter numbers:\n");
for(i=0;i<=n;i++){
scanf("%d",&num);
list[i]=num;
}
printf("%s",list);
}



i wiil be dilight if you help

Answer
Hai dear Bita !!

I found few error's with your programme , check out the corrections done below .,

#include<stdio.h>
void main()
{
  int n,i=0,j=0,num ,list[20];
  printf("Enter n:\n");
  scanf("%d",&n);
  printf("enter numbers:\n");
  for(i=0;i<n;i++){
     scanf("%d",&num);
     list[i]=num;
  }
  for( i = 0 ; i < n; i++)
  printf("%d ",list[i]);
}

Thanks and Regards !
Prince M. Premnath

Revert me in case of issues .,

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.