LAB 2
After this lab students will learn use operators and formatted /unformatted input output. No need to write algorithms and draw flowchart.
5. Write the output of following program and also explain about each output:
#include<stdio.h>
int main()
{
int n=1234;
char ch='A';
char str[10]="Hello World";
printf("1.n=%-6d\n",n);
printf("2.n=%6d\n",n);
printf("3.ch=%-5c\n",ch);
printf("4.ch=%5c\n",ch);
printf("5.string is:%10s\n",str);
printf("6.string is:%10.8s\n",str);
printf("7.string is:%-10.8s\n",str);
return 0:
}